1

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? My current version of Flutter is 3.19.4.

Error log:

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:

  • Flutter : 3.19.4
  • Platform : Android and iOS
  • compileSdkVersion : 34
  • use firebase

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)
0

2 Answers 2

0

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.

Sign up to request clarification or add additional context in comments.

2 Comments

thank you. It didn't work even after updating to Flutter 3.24.1. I updated the question. Some are marked as UNALIGNED.
Does this need to be supported by all plugins?
0

By simply running these commands worked for me.

My Flutter version is 3.19.6.

flutter clean
flutter pub get

You may need run:

flutter upgrade

To Update your flutter sdk version

1 Comment

Currently you are using which version

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.