Repository navigation
Preprovision Android NDK before flavored builds - #183512
Closed
kyungilcho wants to merge 13 commits into
Closed
kyungilcho wants to merge 13 commits into
kyungilcho wants to merge 13 commits into
Conversation
kyungilcho
force-pushed
the
fix/android-cross-flavor-ndk-build
branch
from
March 11, 2026 13:34
bdcc6c8 to
0caaf03
Compare
kyungilcho
force-pushed
the
fix/android-cross-flavor-ndk-build
branch
from
March 11, 2026 14:32
6e2d007 to
a97e76c
Compare
Contributor
|
An existing Git SHA, To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with |
Contributor
Author
|
Closing this in favor of #183555, which rebuilds the change on top of the latest master with a clean two-commit history. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flutter currently forces AGP to download the NDK by configuring an empty CMake project in
forceNdkDownload().In flavored Android apps, that synthetic native configuration can cause AGP to fold generic CMake tasks across flavors, which can pull
compileFlutterBuildtasks from the wrong flavor into the active build.This change moves NDK provisioning into the Flutter tool build flow:
ndkVersionwith a lightweight Gradle metadata taskforceNdkDownload()when the tool has already preprovisioned the NDKThis preserves the original goal of ensuring the NDK is available, while avoiding synthetic native build graph contamination in flavored apps.
Manual validation:
debugandreleaseflutter build apk --debug --flavor devflutter build apk --flavor devflutter build appbundle --flavor devflutter run --flavor devTests:
packages/flutter_tools/test/general.shard/android/android_gradle_builder_test.dartpackages/flutter_tools/test/integration.shard/android_run_flutter_gradle_plugin_tests_test.dartpackages/flutter_tools/test/integration.shard/android_gradle_print_ndk_version_test.dartRefs #183296