Currently my Flutter app doesn't work on devices that support 16KB page size (I checked it on the simulator). What can I do to fix this? The current version of Flutter is 3.19.4。
Error log is
Failure [INSTALL_FAILED_INVALID_APK: INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2]
Error launching application on sdk gphone16k x86 64.
Environments.
I also tried updating to Flutter 3.22.1, but the same error message appeared before and after the update.
Update:
I updated Flutter to 3.24.1 and built it again, but the same error appeared. Also, when I ran the following shell script against the APK built with 3.24.1, the following result was displayed:
https://developer.android.com/guide/practices/page-sizes#test
./build/app/outputs/flutter-apk/target/lib/mips/libpl_droidsonroids_gif.so: \e[32mALIGNED\e[0m (2**16)
./build/app/outputs/flutter-apk/target/lib/armeabi-v7a/libflutter.so: \e[32mALIGNED\e[0m (2**16)
./build/app/outputs/flutter-apk/target/lib/armeabi-v7a/libapp.so: \e[32mALIGNED\e[0m (2**14)
./build/app/outputs/flutter-apk/target/lib/armeabi-v7a/libpl_droidsonroids_gif.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/armeabi-v7a/libbarhopper_v3.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/armeabi-v7a/libface_detector_v2_jni.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/armeabi-v7a/libtoolChecker.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/mips64/libpl_droidsonroids_gif.so: \e[32mALIGNED\e[0m (2**16)
./build/app/outputs/flutter-apk/target/lib/x86/libpl_droidsonroids_gif.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/x86/libbarhopper_v3.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/x86/libface_detector_v2_jni.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/x86/libtoolChecker.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/arm64-v8a/libflutter.so: \e[32mALIGNED\e[0m (2**16)
./build/app/outputs/flutter-apk/target/lib/arm64-v8a/libapp.so: \e[32mALIGNED\e[0m (2**16)
./build/app/outputs/flutter-apk/target/lib/arm64-v8a/libpl_droidsonroids_gif.so: \e[32mALIGNED\e[0m (2**16)
./build/app/outputs/flutter-apk/target/lib/arm64-v8a/libbarhopper_v3.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/arm64-v8a/libface_detector_v2_jni.so: \e[32mALIGNED\e[0m (2**14)
./build/app/outputs/flutter-apk/target/lib/arm64-v8a/libtoolChecker.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/armeabi/libpl_droidsonroids_gif.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/x86_64/libflutter.so: \e[32mALIGNED\e[0m (2**16)
./build/app/outputs/flutter-apk/target/lib/x86_64/libapp.so: \e[32mALIGNED\e[0m (2**16)
./build/app/outputs/flutter-apk/target/lib/x86_64/libpl_droidsonroids_gif.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/x86_64/libbarhopper_v3.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/x86_64/libface_detector_v2_jni.so: \e[31mUNALIGNED\e[0m (2**12)
./build/app/outputs/flutter-apk/target/lib/x86_64/libtoolChecker.so: \e[31mUNALIGNED\e[0m (2**12)
You might be using an outdated version, because this issue is closed already.
This counts for the main
branch, while the version number may be the next.
As explained there, one can check with: readelf -Wl ./libflutter.so
It's rather 3.24.1
.