Skip to content

Support activity-alias in Android launcher activity detection - #187251

Merged
auto-submit[bot] merged 10 commits into
flutter:masterfrom
mboetger:resolve-issue-38965
Sep 12, 2026
Merged

auto-submit[bot] merged 10 commits into
flutter:masterfrom
mboetger:resolve-issue-38965

Conversation

@mboetger

Copy link
Copy Markdown
Contributor

Support activity-alias in Android launcher activity detection

Fixes: #38965

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

mboetger added 2 commits May 14, 2026 22:14
Scan both "<activity>" and "<activity-alias>" elements when parsing raw "AndroidManifest.xml"
in "AndroidApk.fromAndroidProject". This allows applications that define their main launcher
activity via an activity-alias to be successfully detected and launched.
Added unit tests in "application_package_test.dart" to verify activity-alias parsing in both the
raw XML manifest parser and the "aapt" dump parser (which already implicitly supported it).

TAG=agy
CONV=8e04fc99-af40-4f70-9234-266a4f69c16e
…ty resolution

Update raw manifest parser to support '<activity-alias>' elements when searching for main launcher activity. This aligns behavior with compiled manifest parsing which already supports it, and allows apps using activity-alias for launchers to start successfully.

Also fixed parser consistency by breaking on first launcher match, and improved safety against missing name attributes on launcher elements.

TAG=agy
CONV=9697b14d-2ef7-49c4-a41b-7296635fc856
@mboetger
mboetger requested a review from a team as a code owner May 28, 2026 17:48
@mboetger
mboetger requested review from gmackall and removed request for a team May 28, 2026 17:48
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 28, 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 Android application package parsing to support activity-alias elements in the manifest alongside standard activity elements, and adds corresponding unit tests. Feedback on the changes suggests ensuring packageId is not null before setting launchActivity to prevent string interpolation from bypassing subsequent null checks, and using followedBy to lazily concatenate the activity iterables instead of using the spread operator.

Comment thread packages/flutter_tools/lib/src/android/application_package.dart Outdated
Comment thread packages/flutter_tools/lib/src/android/application_package.dart Outdated
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 28, 2026
- Prevent packageId null bypass via string interpolation by adding a defensive null check.
- Optimize XML activity parsing by lazily concatenating iterables with followedBy instead of allocating a list.

TAG=agy
CONV=d492ea8e-4d8e-443f-b7c7-76f68efb5fc4
@github-actions github-actions Bot removed the CICD Run CI/CD label May 29, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 29, 2026
@bkonyi bkonyi added the team-android Owned by Android platform team label Jun 10, 2026
@github-actions github-actions Bot added CICD Run CI/CD and removed CICD Run CI/CD team-android Owned by Android platform team labels Jun 18, 2026
@mboetger mboetger added the l:backlog LLM created PR addressing a backlog issue. label Jun 18, 2026
@bkonyi bkonyi assigned bkonyi and unassigned bkonyi Jun 29, 2026
@bkonyi bkonyi added the team-android Owned by Android platform team label Jun 29, 2026
@github-actions github-actions Bot removed the team-android Owned by Android platform team label Jul 7, 2026
@mboetger mboetger added the platform-android Android applications specifically label Aug 18, 2026
@github-actions github-actions Bot removed the platform-android Android applications specifically label Aug 18, 2026
@putnokiabel

Copy link
Copy Markdown

Hey!
Any update on this PR? Is it only waiting for review by @gmackall or are there still pieces missing (in which case I'd be happy to help out as this bug is super annoying).

@mboetger mboetger added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 10, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 10, 2026
@auto-submit

auto-submit Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/187251, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR.

@mboetger mboetger added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 10, 2026
@auto-submit

auto-submit Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/187251, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 10, 2026
@mboetger mboetger added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 12, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Sep 12, 2026
Merged via the queue into flutter:master with commit 05f1a0b Sep 12, 2026
28 of 29 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 12, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 12, 2026
Roll Flutter from 63b9518f16bc to 2553f89be1ef (62 revisions)

flutter/flutter@63b9518...2553f89

2026-09-12 [email protected] Roll clang to 07d67299a15ce03b053736e2d31a668ee0576987 (flutter/flutter#192607)
2026-09-12 [email protected] Roll Dart SDK from b24b352c29db to 7863887acbfb (3 revisions) (flutter/flutter#192665)
2026-09-12 [email protected] fix(tree): et format --all (flutter/flutter#192669)
2026-09-12 [email protected] Support activity-alias in Android launcher activity detection (flutter/flutter#187251)
2026-09-12 [email protected] fix: regenerate gradle lockfiles for external_textures integration test (flutter/flutter#192657)
2026-09-12 [email protected] Roll Skia from 51aa02b2c195 to e5e96533b732 (4 revisions) (flutter/flutter#192646)
2026-09-12 [email protected] [WebParagraph] Fix text pixelation, glyph clipping, and snapping offsets to avoid subpixel raster caching (flutter/flutter#191736)
2026-09-12 [email protected] fix(tests): Add ruby dep to Mac windowing_test (flutter/flutter#192656)
2026-09-12 [email protected] Remove some `unawaited_futures` outdated ignores (flutter/flutter#192026)
2026-09-11 [email protected] Bump Dart to 3.13, reformat, re-enable formatting check (flutter/flutter#192649)
2026-09-11 [email protected] [android] Isolate API-34 high contrast listener in AccessibilityBridge behind Api34Impl (flutter/flutter#192502)
2026-09-11 [email protected] Update style guide for Dart 3.13 (flutter/flutter#192639)
2026-09-11 [email protected] ci(bringups): remove bringup from these tests (flutter/flutter#192637)
2026-09-11 [email protected] Unmark new_gallery_windows_impeller__transition_perf as bringup (flutter/flutter#192633)
2026-09-11 [email protected] Unmark new_gallery_windows_skia__transition_perf as bringup (flutter/flutter#192635)
2026-09-11 [email protected] Roll Skia from f446aec4ce9e to 51aa02b2c195 (2 revisions) (flutter/flutter#192631)
2026-09-11 [email protected] fix(ci): mac verify binaries still racing (flutter/flutter#192634)
2026-09-11 [email protected] Roll Packages from 8a35b16 to 9caa77c (8 revisions) (flutter/flutter#192630)
2026-09-11 [email protected] Roll Dart SDK from a76fee2722e0 to b24b352c29db (2 revisions) (flutter/flutter#192627)
2026-09-11 [email protected] [tool] Migrate PackagesCommand and Pub to modular dependency injection (flutter/flutter#192460)
2026-09-11 [email protected] [tool] Migrate Darwin framework commands to modular dependency injection (flutter/flutter#192252)
2026-09-11 [email protected] [tool] Migrate Upgrade, Downgrade, and UpdatePackages commands to modular dependency injection (flutter/flutter#190787)
2026-09-11 [email protected] Roll Skia from b3fa80a0e168 to f446aec4ce9e (55 revisions) (flutter/flutter#192620)
2026-09-11 [email protected] Roll Dart SDK from d20d59cfa664 to a76fee2722e0 (2 revisions) (flutter/flutter#192616)
2026-09-11 [email protected] remove deeplink integration tests from bringup (flutter/flutter#192459)
2026-09-11 [email protected] Revert: [devicelab] Clean up Chrome profile directories and trap abort signals in web benchmarks (flutter/flutter#192615)
2026-09-11 [email protected] Roll Fuchsia Linux SDK from C0j8F-_Iy-OQZ6YyI... to m69nfK-wnHaMTe8P9... (flutter/flutter#192608)
2026-09-11 [email protected] Fix Wasm build cache mismatch in ResidentWebRunner and browser 404 fallbacks (flutter/flutter#190786)
2026-09-11 [email protected] Roll Dart SDK from 3ce3116bc9ec to d20d59cfa664 (1 revision) (flutter/flutter#192588)
2026-09-11 [email protected] [Linux] Keep the frame at the top of a resizing subsurface (flutter/flutter#192408)
2026-09-10 [email protected] [devicelab] Clean up Chrome profile directories and trap abort signals in web benchmarks (flutter/flutter#192584)
2026-09-10 [email protected] [web] Keep ImageSource alive until Picture disposal (flutter/flutter#192516)
2026-09-10 [email protected] Remove the accessibility evaluations feature flag (flutter/flutter#192266)
2026-09-10 [email protected] Promote Windows gradient benchmark tests to non-bringup (flutter/flutter#192581)
2026-09-10 [email protected] Remove commented out export in `text_input.dart` since the dart compiler has the correct behavior now (flutter/flutter#191539)
2026-09-10 [email protected] [flutter_tools] Do not mistake server-initiated requests for responses to client requests in AnalysisServer (flutter/flutter#192546)
2026-09-10 [email protected] Roll Packages from 36e088a to 8a35b16 (12 revisions) (flutter/flutter#192550)
2026-09-10 [email protected] Roll pub packages (flutter/flutter#192517)
2026-09-10 [email protected] feat(web): support --web-content-hash for entrypoint files (flutter/flutter#190153)
2026-09-10 [email protected] [web] Stop iOS auto-zoom by sizing semantic inputs at 16px (flutter/flutter#192328)
2026-09-10 [email protected] Roll Dart SDK from 0d55b7a6a9ee to 3ce3116bc9ec (2 revisions) (flutter/flutter#192534)
2026-09-10 [email protected] Update more enum instances comparison to use equality == since dart has the correct behavior now (flutter/flutter#191788)
2026-09-10 [email protected] Fix specify_nonobvious_local_variable_types lints in luci_resultdb_test.dart (flutter/flutter#192543)
2026-09-10 [email protected] Roll ICU from 8cc91d9b6ab9 to 6ebb40c59477 (1 revision) (flutter/flutter#192527)
2026-09-10 [email protected] [Linux] Make the framebuffer depth/stencil buffer optional (flutter/flutter#192156)
2026-09-10 [email protected] [Linux] Cancel input when events stop being delivered (flutter/flutter#192277)
...
putnokiabel added a commit to putnokiabel/flutter that referenced this pull request Sep 14, 2026
…r#187251)

Fixes `flutter run` failing with "package identifier or launch activity
not found" when the MAIN/LAUNCHER intent-filter is declared on an
<activity-alias> rather than directly on an <activity>.

Fixes: flutter#38965

(cherry picked from commit 05f1a0b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD l:backlog LLM created PR addressing a backlog issue. tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using activity-alias as MAIN/LAUNCHER activity will throw an incorrect error when using flutter run

4 participants