Sitelet https://github.com/flutter/flutter/pull/189488
Skip to content

[flutter_tools] Use resolved application ID for app link settings - #189488

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
faheemabbas766:fix/android-app-link-application-id
Aug 25, 2026
Merged

auto-submit[bot] merged 3 commits into
flutter:masterfrom
faheemabbas766:fix/android-app-link-application-id

Conversation

@faheemabbas766

Copy link
Copy Markdown
Contributor

Fixes #179705

The AppLinkSettings Gradle task was writing variant.namespace into the generated JSON. When an app sets applicationId from an environment variable or Gradle property, the namespace can differ from the resolved application ID.

This updates the task to use AGP's resolved ApplicationVariant.applicationId and adds an integration test covering an environment-backed applicationId.

Tests:

  • dart run test -j1 test/integration.shard/android_gradle_outputs_app_link_settings_test.dart
  • FLUTTER_TEST_DISABLE_FS_GUARD=true dart run test -j1 test/commands.shard/hermetic/android_analyze_test.dart

@faheemabbas766
faheemabbas766 requested a review from a team as a code owner July 15, 2026 04:53
@faheemabbas766
faheemabbas766 requested review from jesswrd and removed request for a team July 15, 2026 04:53
@github-actions github-actions Bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Jul 15, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the DeepLinkJsonFromManifestTask to use the resolved applicationId instead of the namespace property, and adds an integration test to verify this behavior. Feedback points out that casting variant directly to ApplicationVariant in FlutterPluginUtils.kt is unsafe and could lead to a ClassCastException for non-application variants, suggesting a safe type check instead.

Comment thread packages/flutter_tools/gradle/src/main/kotlin/FlutterPluginUtils.kt Outdated
@faheemabbas766
faheemabbas766 force-pushed the fix/android-app-link-application-id branch from d06ba18 to 9d20483 Compare July 15, 2026 04:59
@jesswrd jesswrd added the CICD Run CI/CD label Jul 28, 2026
@gmackall
gmackall requested review from a team, gmackall and jesswrd and removed request for a team and jesswrd August 4, 2026 20:53
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Aug 18, 2026

@gmackall gmackall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, seems like switching to namespace was a simply incorrect and a regression. Thanks for this fix!

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 18, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 18, 2026
@auto-submit

auto-submit Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/189488, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.

  • Merge guidelines: A PR needs at least one approved review if the author is already part of flutter-hackers or two member reviews if the author is not a member of flutter-hackers before re-applying the autosubmit label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@gmackall gmackall added the CICD Run CI/CD label Aug 18, 2026
@camsim99
camsim99 requested a review from reidbaker August 18, 2026 21:19
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Aug 25, 2026
@mboetger mboetger added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Aug 25, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Aug 25, 2026
Merged via the queue into flutter:master with commit 8bae903 Aug 25, 2026
26 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD platform-android Android applications specifically team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flutter_tool] flutter analyze --android --output-app-link-settings cannot parse env variable application ID

4 participants