[Android] Fix AAB not including libapp.so #187699
Draft
mboetger wants to merge 5 commits into
Draft
Conversation
gmackall
approved these changes
Jun 9, 2026
gmackall
left a comment
Member
There was a problem hiding this comment.
the idea of this change lgtm, if we can find a syntax that works here (not resolving immediately but letting it act as a provider as it should)
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.
The Bug
In FlutterPlugin.kt , we register the directory containing Flutter's intermediate JNI libraries (like libapp.so ) to the Android source set so Gradle knows to package them:
to the default path (e.g., build/intermediates/flutter/... ).
buildDirectory property.
• Writing: The Flutter task that copies libapp.so uses the lazy jniLibsDir provider, so it correctly resolves the path at Execution Phase and writes the library to the custom directory (
custom_build_dir/intermediates/... ).
• Reading: The Android packaging task reads from the source set we registered earlier. Because we passed a static File resolved eagerly, it looks in the default directory ( build/intermediates/...
), which is empty.
• As a result, libapp.so is silently left out of the final APK/AAB.
──────
The Fix
The fix changes the registration to pass the lazy Provider directly:
custom_build_dir path.
Fixes: #186810
Pre-launch Checklist
///).