-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Native assets support for Android #135148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@stuartmorgan What is the add2app story for standalone Dart packages for Android? Is it not supported? (Packages with native assets are plain old Dart packages with a And, who should review this PR besides you. Note: for now this is just a draft. Linux need to be relanded, and also Windows needs to be landed first. I'm making a draft so I can run tests on the CI and have a place to ask questions. |
I don't have any familiarity with Android add-to-app, so I don't know the answer to this.
@reidbaker probably |
63dbab2 to
c59cf7b
Compare
It looks like we have no NDK on the Windows and Linux bots, we do have an NDK on the MacOS bots. I don't see a mention of the NDK (The failing tests succeed locally on my Linux and Windows machines where the NDK is installed.) @stuartmorgan How do we get the NDK on the bots? I was thinking we should have had it already, because the FFI plugins for Android use it. But it likely gets auto-downloaded there by Gradle. With the FFI packages, we don't have a gradle file that does that. Maybe we could consider generating such a file if we notice there is at least one package with a |
That's probably a question for @reidbaker. |
|
@johnmccutchan As Reid is pretty busy, might you be able to take a look at the questions above and the general approach in this PR? |
67db6dd to
36eec66
Compare
zanderso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some code looks like it was formatted by dartfmt. Could you please follow https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo ?
|
@stuartmorgan IIRC you reviewed some of the other PRs on this project. Would you be able to review/confirm that this PR comports with the other changes that have been landed, at least at a surface level? @christopherfujino for flutter_tool review. |
@godofredoc Can we get the NDK pre-installed on the Windows and Linux bots? "Linux tool_integration_tests_3_4" and "Windows tool_integration_tests_5_6" fail because there is no Android NDK inside the used Android SDK on those bots. |
Support for FFI calls with
@Native externalfunctions through Native assets on Android. This enables bundling native code without any build-system boilerplate code.For more info see:
Implementation details for Android.
Mainly follows the design of the previous PRs.
For Android, we detect the compilers inside the NDK inside SDK.
And bundling of the assets is done by the flutter.groovy file.
The
minSdkVersionis propagated from the flutter.groovy file as well.The NDK is not part of
flutter doctor, and users can omit it if no native assets have to be build.However, if any native assets must be built, flutter throws a tool exit if the NDK is not installed.
Add 2 app is not part of this PR yet, instead
flutter build aarwill tool exit if there are any native assets.Pre-launch Checklist
///).