Currently I'm building a UnityPlayer-Plugin for Flutter. Therefore I include some external libraries as static libraries(Unity, Vuforia). Integration into Flutter app brings problems. As you can see in APK Analyzing when flutter builds the app its creates additional ABI architectures for
- x86 (only flutter.so)
- x86_64 (only flutter.so)
- arm_64-v8a (only flutter.so)
- armabi-v7a (not flutter.so, but all *.so from third party libs)
Currently Unity is not supporting x64 builds and I'm using a arm64-v8a device for testing. This device will automatically use arm64-v8a in jniLibs which only has flutter inside and no unity libraries.
What's the best way to get Unity libraries to x86 and armabi-v7a and 64 bit (arm_64-v8a,x86_64) devices use as fallback (armabi-v7a,x86).
First tries with gradle Split APK's were overwritten bei flutter.gradle and I don't find a way to get the flutter.so to armabi-v7a.
In the end I would image something like this.
- x86 (flutter.so, libunity.so, libVuforia.so,...) -> used by x86 devices
- armabi-v7a (flutter.so, libunity.so, libVuforia.so,...) -> armabi-v7a devices
- x86_64 (only flutter.so) -> use libunity.so, libVuforia.so,... from x86 as fallback
- arm_64-v8a (only flutter.so)-> libunity.so, libVuforia.so,... from armabi-v7a as fallback
Hope my usecase is clear and hope to get feedback soon.