Closed ltOgt closed 1 year ago
Manually including the following in android/app/build.gradle
seems to fix this:
...
android {
...
buildTypes {
release {
...
ndk {
// explicit list of supported targets
// implicit excluded 'x86'
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
}
}
}
}
But would be nice if this was not necessary, since it works fine out of the box when not using drift
First of all, thanks for building and maintaining this awesome package!
Thanks!
As you've found out, explicitly adding an abiFilters
entry to the Gradle buildscript fixes the problem. I agree that it would be very nice if this wasn't necessary, and with a future Flutter/Dart release with this feature we won't need this.
At the moment, the only reliable way to bundle native code in a Flutter plugin (like sqlite3_flutter_libs
) in this case is to publish a precompiled library to a repository. That library needs to support all architectures an app might want to support, which includes x86. Some Flutter users are running production apps on x86, but this is a very weird setup because it's not supported by Dart's AOT compiler so they essentially run a JIT build without assertions. We include x86
to support these users (and since it might be useful for those testing their apps on an emulator).
However, it seems like there is no way for that library to say "just include the platforms that the main app supports" without you adding that abiFilters
call. This is documented in the readme here, but since most users probably don't care about that package and just blindly add it because I recommend it in drift's documentation, I'm being a bit irresponsible here. I will update the documentation to mention this limitation but without native assets, I think that's all I can do.
First of all, thanks for building and maintaining this awesome package!
Google Play Consoles Pre-Launch report gave me the following issue:
After some digging i found that bundling my project (
flutter build appbundle
) included an incompletex86
directory.Whereas no such directory was included at all when bundling a project without
drift
.I opened the resulting
app-release.abb
withArchive Utility
, and under.../build/app/outputs/bundle/release/app-release/base/lib/x86/
i getwithout
drift
(content the same for each)with
drift
(missing "libflutter.so")This may be a flutter issue instead, not sure.