You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The engine Java build scripts generate a BuildConfig.java file containing flags indicating whether this is a debug, profile, or release build. Some embedder Java code is conditional on these flags.
So we would need to ship different flutter.jar binaries for debug, profile, and release.
Some options:
Use the current format where each target platform has its own flutter.jar which includes libflutter.so. If the APK needs to support multiple ABIs, then extract the libflutter.so binaries for the other ABIs from those platforms' flutter.jar files.
Ship separate versions of flutter.jar containing only Java code for debug, profile, and release. Alongside each flutter.jar, provide libflutter.so binaries for each supported target platform. The libflutter.so files could be packaged inside JARs that place them within that platform's lib/$ABI path.
Thanks for the background @jason-simmons. This is helpful!
Use the current format where each target platform has its own flutter.jar which includes libflutter.so. If the APK needs to support multiple ABIs, then extract the libflutter.so binaries for the other ABIs from those platforms' flutter.jar files.
This is the implementation after my changes.
On a side note, do you know why libflutter.so is duplicated in x64 & x86 (it's in flutter.jar and also outside)?
I think we were distributing libflutter.so artifacts for all platforms in the early days of Flutter before flutter.jar existed.
The libflutter.so artifacts were removed after the migration to flutter.jar on most platforms. But they had to be kept around for x86/x64 because the Gradle script was using them to create ARM/x86/x64 APKs in debug mode.
This update would resolve this issue, doesn't it? Currently, I cannot run my (released) Flutter app in x86 devices. This issue is known and still stays there for a long time.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
blasten commentedon May 20, 2019
Actually, this new structure may increase the size of the artifacts by
28M.(663M -> 691M)jason-simmons commentedon May 20, 2019
The engine Java build scripts generate a
BuildConfig.javafile containing flags indicating whether this is a debug, profile, or release build. Some embedder Java code is conditional on these flags.So we would need to ship different
flutter.jarbinaries for debug, profile, and release.Some options:
flutter.jarwhich includeslibflutter.so. If the APK needs to support multiple ABIs, then extract thelibflutter.sobinaries for the other ABIs from those platforms'flutter.jarfiles.flutter.jarcontaining only Java code for debug, profile, and release. Alongside eachflutter.jar, providelibflutter.sobinaries for each supported target platform. Thelibflutter.sofiles could be packaged inside JARs that place them within that platform'slib/$ABIpath.blasten commentedon May 21, 2019
Thanks for the background @jason-simmons. This is helpful!
This is the implementation after my changes.
On a side note, do you know why
libflutter.sois duplicated inx64&x86(it's influtter.jarand also outside)?flutter/packages/flutter_tools/gradle/flutter.gradle
Lines 211 to 221 in 90f3890
Also, it doesn't seem like like
android-x64/flutter.jarorandroid-x86/flutter.jaris ever used.jason-simmons commentedon May 21, 2019
I think we were distributing
libflutter.soartifacts for all platforms in the early days of Flutter beforeflutter.jarexisted.The
libflutter.soartifacts were removed after the migration toflutter.jaron most platforms. But they had to be kept around for x86/x64 because the Gradle script was using them to create ARM/x86/x64 APKs in debug mode.hnvn commentedon May 21, 2019
This update would resolve this issue, doesn't it? Currently, I cannot run my (released) Flutter app in x86 devices. This issue is known and still stays there for a long time.
blasten commentedon Jun 15, 2019
cc @tvolkert @xster @matthew-carroll
blasten commentedon Oct 10, 2019
Gradle now consumes Flutter Maven artifacts, so this issue isn't relevant at this point.
github-actions commentedon Aug 27, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.