Skip to content

[flutter_tools] Explain unsupported Android AOT builds on Linux arm64 hosts - #194453

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
dbebawy:linux-arm64-android-aot-error
Oct 29, 2026
Merged

auto-submit[bot] merged 1 commit into
flutter:masterfrom
dbebawy:linux-arm64-android-aot-error

Conversation

@dbebawy

@dbebawy dbebawy commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

On Linux arm64 hosts, any profile or release Android build fails with a raw ProcessException, because the Flutter SDK does not include gen_snapshot for Android on this host. This PR replaces that with a ToolExit that says the configuration is not supported, shows the path the tool expected, and links the feature request.

If a gen_snapshot has been placed at the expected path (for example, a self-built binary), the build still uses it, so existing workarounds keep working.

Since #193647 the build target has no access to OperatingSystemUtils, so it recognizes a Linux arm64 host from the linux-arm64 directory that the cached artifacts put gen_snapshot in. Builds that use a local engine are not affected.

Output of the flutter assemble step that flutter build apk --release runs, captured in a linux/arm64 Debian container with the SDK at /flutter (master 8274c72, then with this change applied):

Before:

Target android_aot_release_android-arm64 failed: ProcessException: Failed to find "/flutter/bin/cache/artifacts/engine/android-arm64-release/linux-arm64/gen_snapshot" in the search path.
  Command: /flutter/bin/cache/artifacts/engine/android-arm64-release/linux-arm64/gen_snapshot

After:

Target android_aot_release_android-arm64 failed: Error: Building Android apps in release mode is not supported on Linux arm64 hosts because the Flutter SDK does not include gen_snapshot for this host (expected at /flutter/bin/cache/artifacts/engine/android-arm64-release/linux-arm64/gen_snapshot).
See https://github.com/flutter/flutter/issues/75864 for details.

This does not add Linux arm64 host support for Android builds; that is tracked in #75864.

Fixes #168980

Pre-launch Checklist

@dbebawy
dbebawy requested a review from a team as a code owner October 15, 2026 15:52
@dbebawy
dbebawy requested review from reidbaker and removed request for a team October 15, 2026 15:52
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Oct 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 adds a check in AndroidAot to handle cases where gen_snapshot is missing on Linux arm64 hosts targeting Android. Instead of failing with a ProcessException, it now throws a descriptive ToolExit with an actionable error message and a link to the relevant GitHub issue. It also adds corresponding unit tests to verify this behavior when gen_snapshot is missing and when it is present. I have no feedback to provide.

@dbebawy

dbebawy commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Hi @reidbaker, just checking whether you have had a chance to look at this. I am happy to change anything if a different approach would fit better.

@reidbaker
reidbaker requested review from mboetger and removed request for reidbaker October 26, 2026 19:28
@reidbaker

reidbaker commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

So sorry this slipped through my review cracks. Thank you for your contributions to flutter.

@dbebawy

dbebawy commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Thank you, @reidbaker. I do not have permission to add labels. Could you add CICD and autosubmit when you have a chance?

@reidbaker reidbaker added the CICD Run CI/CD label Oct 26, 2026
@reidbaker

Copy link
Copy Markdown
Member

We require 2 approvals so @mboetger can add auto submit if he agrees with me. Cicd added and again sorry for the slow review

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

auto-submit Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/194453, 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.

@auto-submit

auto-submit Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

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

The Flutter SDK does not ship gen_snapshot for Linux arm64 hosts
targeting Android, so profile and release Android builds on these hosts
fail with a raw ProcessException about a missing
linux-arm64/gen_snapshot. Replace it with a ToolExit that says the
configuration is unsupported, shows the expected path, and links the
feature request.

A gen_snapshot placed at the expected path is still used, so
self-built binaries keep working.

Fixes flutter#168980
@dbebawy
dbebawy force-pushed the linux-arm64-android-aot-error branch from 129a2a5 to d2968fb Compare October 27, 2026 01:10
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Oct 27, 2026
@dbebawy

dbebawy commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Thank you both. I rebased onto master to clear both of the bot's reasons; the change itself is the same. The push removed the CICD label, so could one of you re-add CICD and autosubmit?

@mboetger mboetger added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Oct 27, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 27, 2026
@auto-submit

auto-submit Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

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

@dbebawy

dbebawy commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for adding the labels. The only failure was Mac tool_tests_general, where "Flutter Package Migration validate project settings throw if settings fail to compile" in swift_package_manager_integration_migration_test.dart timed out after 2 seconds. That test is in the iOS migration code, which this PR does not touch, so I think it is a flake, but I could not find an issue for it. Could someone re-run that job and re-add autosubmit?

@reidbaker reidbaker added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 29, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

3 participants