Repository navigation
Flutter app drops java.lang.UnsatisfiedLinkError #23055
Copy link
Copy link
Closed
Labels
c: crashStack traces logged to the consoleStack traces logged to the consolecustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.platform-androidAndroid applications specificallyAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
I've built an app written on Flutter and it's running well on my device.
On client device however it is crashing at start (even before Centry initiates).
The only log I have from GooglePlay:
at java.lang.Runtime.loadLibrary (Runtime.java:367)
at java.lang.System.loadLibrary (System.java:1076)
at io.flutter.view.FlutterMain.startInitialization (FlutterMain.java:172)
at io.flutter.view.FlutterMain.startInitialization (FlutterMain.java:149)
at io.flutter.app.FlutterApplication.onCreate (FlutterApplication.java:22)
at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1037)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6496)
at android.app.ActivityThread.access$1800 (ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1887)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:148)
at android.app.ActivityThread.main (ActivityThread.java:7406)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)
I'm building specifically using arm64 (app crashes even on my device if I'm trying to run on arm (32).
flutter build apk --release --target-platform=android-arm64
Flutter doctor gives no issues:
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-UA)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.1)
[✓] VS Code (version 1.28.0)
[✓] Connected devices (1 available)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
c: crashStack traces logged to the consoleStack traces logged to the consolecustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.platform-androidAndroid applications specificallyAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
AlexBacich commentedon Oct 19, 2018
Solution is described in this article. https://medium.com/flutterpub/flutter-app-couldnt-find-libflutter-so-c95ad81cbccd
In build.gradle of app this lines should be added:
Build should be made using
flutter build apkrlee1990 commentedon Oct 27, 2018
Looks like I had the same issue. This bug really needs to be fixed.
My issue #23627
Hixie commentedon Oct 30, 2018
cc @zanderso
Hixie commentedon Nov 14, 2018
cc @jason-simmons
jason-simmons commentedon Nov 14, 2018
Android does not support loading 32-bit and 64-bit ARM native libraries within the same process. If your app includes another 32-bit library, then the app's build scripts will need to explicitly select the 32-bit version of Flutter.
Alternatively, the app could include both 32-bit and 64-bit versions of Flutter within the same package. But that will increase the size of the APK.
rockwotj commentedon Nov 20, 2018
Instead of only having a certain arch, #24440 would be the ideal solution to this.
Hixie commentedon Nov 21, 2018
If Android bundles do resolve this, that does seem like the better solution. Let's wait for #24440 to be fixed before doing further work here.
15 remaining items
GyuriMajercsik commentedon Aug 15, 2019
We got the following exception in production ~13 times from two devices:
The release was built with
flutter build appbundle, so it should contain both 32 and 64 bit versions. The used Flutter version is:Flutter 1.7.8+hotfix.4channel stable.gofur commentedon Aug 16, 2019
i got same errors ?? any update ? @pranayairan or others can help??
Asus ZenFone 2 (ZE550ML) (Z008_1), Android 5.0
java.lang.UnsatisfiedLinkError: at java.lang.Runtime.loadLibrary (Runtime.java:366) at java.lang.System.loadLibrary (System.java:989) at io.flutter.view.FlutterMain.startInitialization (FlutterMain.java:122) at io.flutter.view.FlutterMain.startInitialization (FlutterMain.java:99) at io.flutter.app.FlutterApplication.onCreate (FlutterApplication.java:22) at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1011) at android.app.ActivityThread.handleBindApplication (ActivityThread.java:4550) at android.app.ActivityThread.access$1500 (ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1342) at android.os.Handler.dispatchMessage (Handler.java:102) at android.os.Looper.loop (Looper.java:135) at android.app.ActivityThread.main (ActivityThread.java:5253) at java.lang.reflect.Method.invoke (Native Method) at java.lang.reflect.Method.invoke (Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:900) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:695)Row7 commentedon Sep 10, 2019
Same problem here with these devices:
The release was built with
flutter build appbundleon stable channel.zanderso commentedon Sep 10, 2019
@blasten Would you mind taking a quick look at this one to see if there's any new advice in light of your recent work. Thanks!
davidmartos96 commentedon Sep 14, 2019
@Row7 What version of Flutter is it? 1.7.8 or 1.9.1?
Row7 commentedon Sep 14, 2019
1.7.8
mohlam12 commentedon Sep 16, 2019
Same problem on emulator when deploying a release-built apk (without even spliting per abis)
FATAL EXCEPTION: main Process: XXXXXXXX, PID: 9530 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/XXXXXXXX-iYKv7sNLXGEKuJRp42Y1YA==/base.apk"],nativeLibraryDirectories=[/data/app/XXXXXXXX-iYKv7sNLXGEKuJRp42Y1YA==/lib/x86, /data/app/XXXXXXXX-iYKv7sNLPGEKuJRp42Y1YA==/base.apk!/lib/x86, /system/lib, /system/product/lib]]] couldn't find "libflutter.so"blasten commentedon Sep 16, 2019
@mohlam12 It looks you need an ARM32 or ARM64 emulator if you running a release (fat) APK.
Update on this issue:
A few things have changed since this issue was filed, Flutter supports fat APKs, split APK per ABI APKs and App bundles. This currently works for ARM32 and ARM64 devices. Additionally, we plan to add support for x86_64 soon (Follow #9253 for updates. cc @jonahwilliams).
As a result, I'm closing this issue.
creativecreatorormaybenot commentedon Nov 4, 2019
@blasten I do not understand why you closed this. This issue is not fixed and it is the most frequent crash for my app on Android.
Maybe the work regarding #9253 added the possibility to fix it, however, I do not understand how to do it, i.e.
flutter build appbundledoes not fix it and I followed these issues, but could not figure out what I can do to includelibflutter.so(as it seems that it is not included by default for some devices).blasten commentedon Nov 4, 2019
@creativecreatorormaybenot #23055 (comment)
creativecreatorormaybenot commentedon Nov 5, 2019
@blasten I am using Android App Bundles. I might just not understand what you are saying there.
aldwnesx commentedon Mar 27, 2020
how do you publish two different apks version number? i tdoesn't allow me to generate two same version but iw ant to publish both arm and arm64
lock commentedon Apr 19, 2020
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.