Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter app crashes on start on Android: couldn't find "libflutter.so" #32756

Closed
Zazo032 opened this issue May 15, 2019 · 92 comments
Closed

Flutter app crashes on start on Android: couldn't find "libflutter.so" #32756

Zazo032 opened this issue May 15, 2019 · 92 comments
Labels
a: build Building flutter applications with the tool a: production Issues experienced in live production apps a: release Challenges faced when attempting to productionize an app c: fatal crash Crashes that terminate the process customer: crowd Affects or could affect many people, though not necessarily a specific customer. platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@Zazo032
Copy link
Contributor

Zazo032 commented May 15, 2019

Steps to Reproduce

Build an APK or bundle on latest master commit, install on any device and the app will crash before it starts. Running debug version doesn't crash, and running via flutter run --release doesn't crash either.

Logs

flutter doctor --verbose

[✓] Flutter (Channel master, v1.5.9-pre.258, on Mac OS X 10.14.5 18F131a, locale es-ES)
    • Flutter version 1.5.9-pre.258 at /Applications/flutter
    • Framework revision 7d667decd5 (40 minutes ago), 2019-05-15 04:35:39 -0400
    • Engine revision 208011758f
    • Dart version 2.3.1 (build 2.3.1-dev.0.0 a0290f823c)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/cristianzazo/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • ios-deploy 1.9.4
    • CocoaPods version 1.7.0.rc.1

[✓] Android Studio
    • Android Studio at /Applications/Android Studio 3.4 Preview.app/Contents
    • Flutter plugin version 32.0.2
    • Dart plugin version 183.4733
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 35.3.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.
Process finished with exit code 0

The critical error log is this:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.beswapper.com.swapppremium-GZniIhJpEEHMaBHD2a4UGQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.beswapper.com.swapppremium-GZniIhJpEEHMaBHD2a4UGQ==/lib/arm64, /data/app/com.beswapper.com.swapppremium-GZniIhJpEEHMaBHD2a4UGQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "libflutter.so"
FATAL EXCEPTION: main
Process: com.beswapper.com.swapppremium, PID: 10735
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.beswapper.com.swapppremium-GZniIhJpEEHMaBHD2a4UGQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.beswapper.com.swapppremium-GZniIhJpEEHMaBHD2a4UGQ==/lib/arm64, /data/app/com.beswapper.com.swapppremium-GZniIhJpEEHMaBHD2a4UGQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "libflutter.so"
	at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
	at java.lang.System.loadLibrary(System.java:1669)
	at io.flutter.view.FlutterMain.b(:34)
	at io.flutter.app.FlutterApplication.onCreate(Unknown Source:3)
	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5920)
	at android.app.ActivityThread.access$1100(ActivityThread.java:200)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:193)
	at android.app.ActivityThread.main(ActivityThread.java:6718)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

java.lang.UnsatisfiedLinkError: Error unpacking from JAR: Couldn't find SDK library in JAR.. Attempting to unpack from JAR because of previous error: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.touchtype.swiftkey-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libswiftkeysdk-java-internal.so"
FATAL EXCEPTION: pool-3-thread-1
Process: com.touchtype.swiftkey, PID: 13895
java.lang.UnsatisfiedLinkError: Error unpacking from JAR: Couldn't find SDK library in JAR.. Attempting to unpack from JAR because of previous error: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.touchtype.swiftkey-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libswiftkeysdk-java-internal.so"
	at com.touchtype_fluency.impl.NativeLibLoader.loadOrUnpack(s:51)
	at com.touchtype_fluency.SwiftKeySDK.<clinit>(s:86)
	at cxl.run(s:1091)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
	at java.lang.Thread.run(Thread.java:818)
Error reporting crash
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
	at android.os.Handler.<init>(Handler.java:200)
	at android.os.Handler.<init>(Handler.java:114)
	at android.content.AsyncQueryHandler.<init>(AsyncQueryHandler.java:125)
	at net.oneplus.odm.insight.tracker.AbstractTracker$TrackerAsyncQueryHandler.<init>(AbstractTracker.java:110)
	at net.oneplus.odm.insight.tracker.AbstractTracker.<init>(AbstractTracker.java:60)
	at net.oneplus.odm.insight.tracker.AppTracker.<init>(AppTracker.java:24)
	at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:99)
	at gsj.uncaughtException(s:209)
	at ics.uncaughtException(s:207)
	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
@Zazo032 Zazo032 changed the title flutter build apk crashes: couldn't find "libflutter.so" Flutter app crashes on start on Android: couldn't find "libflutter.so" May 15, 2019
@Zazo032
Copy link
Contributor Author

Zazo032 commented May 28, 2019

Can someone take a look into this? Generated release apk is still crashing.

cc/ @dnfield @jonahwilliams @goderbauer @Hixie

@KsAmJ
Copy link

KsAmJ commented Jun 1, 2019

i am facing the same here

2019-06-01 08:41:40.383 26507-26507/? E/com.cubic.app: Not starting debugger since process cannot load the jdwp agent. 2019-06-01 08:41:40.588 26507-26507/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.cubic.app, PID: 26507 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.cubic.app-y6uTLFt_-G5lPyiY3z_6_A==/base.apk"],nativeLibraryDirectories=[/data/app/com.cubic.app-y6uTLFt_-G5lPyiY3z_6_A==/lib/arm64, /data/app/com.cubic.app-y6uTLFt_-G5lPyiY3z_6_A==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]] couldn't find "libflutter.so" at java.lang.Runtime.loadLibrary0(Runtime.java:1012) at java.lang.System.loadLibrary(System.java:1669) at io.flutter.view.FlutterMain.startInitialization(FlutterMain.java:167) at io.flutter.view.FlutterMain.startInitialization(FlutterMain.java:143) at io.flutter.app.FlutterApplication.onCreate(FlutterApplication.java:22) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6217) at android.app.ActivityThread.access$1200(ActivityThread.java:237) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1785) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7045) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)

@KsAmJ
Copy link

KsAmJ commented Jun 1, 2019

this helped me resolving the issue

In build.gradle of app this lines should be added:

android { ... defaultConfig { .... ndk { abiFilters 'armeabi-v7a' } }

@Zazo032
Copy link
Contributor Author

Zazo032 commented Jun 1, 2019

That fixes the issue because it only generates a 32bit version of the APK, but there should be a 64bit option too

@Zazo032
Copy link
Contributor Author

Zazo032 commented Jun 12, 2019

Fixed in latest master release (flutter: ^1.7.4-pre.71)

@Zazo032 Zazo032 closed this as completed Jun 12, 2019
@KsAmJ
Copy link

KsAmJ commented Jun 12, 2019

should we be on stable channel or master?

@Zazo032
Copy link
Contributor Author

Zazo032 commented Jun 12, 2019

Master is less reliable and things can break but has more features that eventually will arrive to stable channel

@Merthan
Copy link

Merthan commented Jun 21, 2020

Still happening on 1.19.0-4.1.pre:

[√] Flutter (Channel beta, 1.19.0-4.1.pre, on Microsoft Windows [Version 10.0.18362.900], locale en-DE)
    • Flutter version 1.19.0-4.1.pre at C:\Users\mert\AppData\Local\Android\flutter
    • Framework revision f994b76974 (12 days ago), 2020-06-09 15:53:13 -0700
    • Engine revision 9a28c3bcf4
    • Dart version 2.9.0 (build 2.9.0-14.1.beta)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\mert\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 46.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[!] IntelliJ IDEA Community Edition (version 2018.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[√] Connected device (1 available)
    • Pixel 3a • 94AAY0LKJZ • android-arm64 • Android 11 (API 30)

! Doctor found issues in 1 category.


Launching lib\main.dart on Pixel 3a in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
E/FlutterLoader( 6660): Flutter initialization failed.
E/FlutterLoader( 6660): java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
E/FlutterLoader( 6660): 	at java.util.concurrent.FutureTask.report(FutureTask.java:123)
E/FlutterLoader( 6660): 	at java.util.concurrent.FutureTask.get(FutureTask.java:193)
E/FlutterLoader( 6660): 	at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(FlutterLoader.java:193)
E/FlutterLoader( 6660): 	at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:207)
E/FlutterLoader( 6660): 	at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:188)
E/FlutterLoader( 6660): 	at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:154)
E/FlutterLoader( 6660): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine(FlutterActivityAndFragmentDelegate.java:229)
E/FlutterLoader( 6660): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:151)
E/FlutterLoader( 6660): 	at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:409)
E/FlutterLoader( 6660): 	at android.app.Activity.performCreate(Activity.java:7984)
E/FlutterLoader( 6660): 	at android.app.Activity.performCreate(Activity.java:7973)
E/FlutterLoader( 6660): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
E/FlutterLoader( 6660): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3329)
E/FlutterLoader( 6660): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3500)
E/FlutterLoader( 6660): 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
E/FlutterLoader( 6660): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/FlutterLoader( 6660): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/FlutterLoader( 6660): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2049)
E/FlutterLoader( 6660): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/FlutterLoader( 6660): 	at android.os.Looper.loop(Looper.java:223)
E/FlutterLoader( 6660): 	at android.app.ActivityThread.main(ActivityThread.java:7523)
E/FlutterLoader( 6660): 	at java.lang.reflect.Method.invoke(Native Method)
E/FlutterLoader( 6660): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/FlutterLoader( 6660): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
E/FlutterLoader( 6660): Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
E/FlutterLoader( 6660): 	at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
E/FlutterLoader( 6660): 	at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
E/FlutterLoader( 6660): 	at java.lang.System.loadLibrary(System.java:1664)
E/FlutterLoader( 6660): 	at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:145)
E/FlutterLoader( 6660): 	at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:140)
E/FlutterLoader( 6660): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/FlutterLoader( 6660): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/FlutterLoader( 6660): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FlutterLoader( 6660): 	at java.lang.Thread.run(Thread.java:923)

Edit:

Seems like uninstalling the app and reinstalling fixed it, error occured without changing anything in the code, just opened up Android studio again and pressed the run button

@abhinavsingh
Copy link

abhinavsingh commented Jul 19, 2020

Yesterday I submitted an app to test track. I am getting crashlytics notifications about this exact exceptions from pre-launch reports. I am using dev channel, find flutter doctor -v below:

[✓] Flutter (Channel dev, 1.21.0-1.0.pre, on Mac OS X 10.15.5 19F101, locale en-US)
    • Flutter version 1.21.0-1.0.pre at /Users/abhinavsingh/Dev/flutter
    • Framework revision f25bd9c55c (4 days ago), 2020-07-14 20:26:01 -0400
    • Engine revision 99c2b3a245
    • Dart version 2.9.0 (build 2.9.0-21.0.dev 20bf2fcf56)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/abhinavsingh/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    ✗ Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.47.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.12.2

Per crashlytics, only Nexus 5 (32-bit device?), Android OS 6.0.1 seems to be effected by this. While I investigate further into it, wanted to report this, as it is going to effect production releases.

@Sepehr13
Copy link

Sepehr13 commented Aug 10, 2020

This is still happening in flutter v1.20.1 PLEASE SOMEONE FIX THIS ISSUE I'M ABOUT TO GET SUED!!!!
the release version was working fine just 2 or 3 days ago. this just happend out of NO WHERE

`[√] Flutter (Channel stable, 1.20.1, on Microsoft Windows [Version 10.0.18362.959], locale en-US)
• Flutter version 1.20.1 at C:\flutter
• Framework revision 2ae3451 (5 days ago), 2020-08-05 19:53:19 -0700
• Engine revision c8e3b94853
• Dart version 2.9.0

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\Sepehr\AppData\Local\Android\Sdk
• Platform android-29, build-tools 28.0.3
• ANDROID_HOME = C:\Users\Sepehr\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.

[!] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[!] IntelliJ IDEA Community Edition (version 2019.2)
• IntelliJ at E:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.4
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins

[√] VS Code (version 1.47.3)
• VS Code at C:\Users\Sepehr\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.13.2

[√] VS Code, 64-bit edition (version 1.33.0)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.13.2

[√] Connected device (1 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator)`

here's the error from android studio:

E/FlutterLoader: Flutter initialization failed. java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/lib/x86, /data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk!/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libflutter.so" at java.util.concurrent.FutureTask.report(FutureTask.java:123) at java.util.concurrent.FutureTask.get(FutureTask.java:193) at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(Unknown Source:23) at io.flutter.embedding.engine.FlutterEngine.<init>(Unknown Source:150) at io.flutter.embedding.engine.FlutterEngine.<init>(Unknown Source:19) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine(Unknown Source:110) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(Unknown Source:7) at io.flutter.embedding.android.FlutterActivity.onCreate(Unknown Source:22) at android.app.Activity.performCreate(Activity.java:6975) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/lib/x86, /data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk!/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libflutter.so" at java.lang.Runtime.loadLibrary0(Runtime.java:1011) at java.lang.System.loadLibrary(System.java:1657) at io.flutter.embedding.engine.loader.FlutterLoader$1.call(Unknown Source:10) at io.flutter.embedding.engine.loader.FlutterLoader$1.call(Unknown Source:0) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764) 2020-08-10 23:31:33.067 25238-25238/? D/AndroidRuntime: Shutting down VM 2020-08-10 23:31:33.067 25238-25238/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.moshaveron.app, PID: 25238 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.moshaveron.app/com.example.moshaveron.MainActivity}: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/lib/x86, /data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk!/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libflutter.so" at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/lib/x86, /data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk!/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libflutter.so" at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(Unknown Source:246) at io.flutter.embedding.engine.FlutterEngine.<init>(Unknown Source:150) at io.flutter.embedding.engine.FlutterEngine.<init>(Unknown Source:19) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine(Unknown Source:110) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(Unknown Source:7) at io.flutter.embedding.android.FlutterActivity.onCreate(Unknown Source:22) at android.app.Activity.performCreate(Activity.java:6975) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)  at android.app.ActivityThread.-wrap11(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)  at android.os.Handler.dispatchMessage(Handler.java:105)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6541)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)  Caused by: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/lib/x86, /data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk!/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libflutter.so" at java.util.concurrent.FutureTask.report(FutureTask.java:123) at java.util.concurrent.FutureTask.get(FutureTask.java:193) at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(Unknown Source:23) at io.flutter.embedding.engine.FlutterEngine.<init>(Unknown Source:150)  at io.flutter.embedding.engine.FlutterEngine.<init>(Unknown Source:19)  at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine(Unknown Source:110)  at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(Unknown Source:7)  at io.flutter.embedding.android.FlutterActivity.onCreate(Unknown Source:22)  at android.app.Activity.performCreate(Activity.java:6975)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)  at android.app.ActivityThread.-wrap11(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)  at android.os.Handler.dispatchMessage(Handler.java:105)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6541)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)  Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/lib/x86, /data/app/com.moshaveron.app-tur5d4wo4GSRQdZg98Na2Q==/base.apk!/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libflutter.so" at java.lang.Runtime.loadLibrary0(Runtime.java:1011) at java.lang.System.loadLibrary(System.java:1657) at io.flutter.embedding.engine.loader.FlutterLoader$1.call(Unknown Source:10) at io.flutter.embedding.engine.loader.FlutterLoader$1.call(Unknown Source:0) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 2020-08-10 23:31:33.067 25238-25238/? E/AndroidRuntime: at java.lang.Thread.run(Thread.java:764) 2020-08-10 23:31:33.081 1679-7137/? W/ActivityManager: Force finishing activity com.moshaveron.app/com.example.moshaveron.MainActivity 2020-08-10 23:31:33.089 1679-1714/? I/ActivityManager: Showing crash dialog for package com.moshaveron.app u0

And here's a list of all my plugins:

cupertino_icons: ^0.1.3
provider: ^4.1.3
shared_preferences: ^0.5.6
animations: ^1.1.1
flutter_svg: ^0.17.4
page_indicator: ^0.3.0
pin_code_fields: ^3.1.2
shimmer: ^1.1.1
carousel_slider: ^2.2.1
like_button: ^1.0.1
flutter_picker: ^1.1.5
image_picker: ^0.6.7+4
image_cropper: ^1.2.3
path_provider: ^1.6.11
file_picker: ^1.12.0
dio: ^3.0.9
connectivity: ^0.4.9
transparent_image: ^1.0.0
rxdart: ^0.24.1
string_validator: ^0.1.4
package_info: ^0.4.1
url_launcher: ^5.5.0
cached_network_image: ^2.2.0+1
sliding_up_panel: ^1.0.2
intl: ^0.16.1
simple_animations: ^2.2.1
video_player: ^0.10.11+2
flutter_colorpicker: ^0.3.4
font_awesome_flutter: ^8.8.1
random_color: ^1.0.5
http: ^0.12.2
socket_io_client: ^0.9.11
flutter_webrtc: ^0.2.8
fluttertoast: ^7.0.2

@abhinavsingh
Copy link

I don't understand how and why was this even closed. Can someone chime on this ongoing issue?

@Sepehr13
Copy link

Any update?? this is a serious problem that needs to be solved

@iNima
Copy link

iNima commented Aug 12, 2020

I don't know if it works for others as well or not but for me it works.

The only trick for me was to disconnect all Android devices before creating the APK. By doing so, it adds libflutter.so into all required lib folders.
Previously, I created the APK while my laptop connected to a Samsung S20 device and it seems that it didn't include libflutter.so into the lib folders that are not related to the S20 CPU architecture. So, for example, it was not working on a Samsung A11.

When I created the APK without connecting the laptop to an Android device the final APK was 15Mb bigger than the previous one and it worked on both S20 and A11 successfully.

I hope it helps.

@endrelovas
Copy link

Flutter clean + Uninstall resolved the issue. But tell me I do not have to do it every single time...

@fida1989
Copy link

fida1989 commented Sep 6, 2020

I just got a report from Crashlytics today about this same error faced by a new user of my app.

Unable to start activity ComponentInfo{xxx.xxx.xxx/xxx.xxx.xxx.MainActivity}: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/xxx.xxx.xxx/base.apk"],nativeLibraryDirectories=[/data/app/xxx.xxx.xxx/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libflutter.so"

Following is my flutter doctor summary:
Screenshot at 2020-09-06 18-58-20

@yeahia2508
Copy link

yeahia2508 commented Sep 7, 2020

Why this issue closed? Lots of crash happening for this issue .

@fehernyul
Copy link

fehernyul commented Sep 7, 2020

I have the same error. I have Flutter 1.20.3 stable from channel, and before build apk, I was cleaned the project and unattached all (the only one emulator...) devices!
But still have the problem.

@Vivamaster
Copy link

I'm still receiving these errors in Crashlytics.

[√] Flutter (Channel stable, 1.20.3, on Microsoft Windows [Version 6.1.7601], locale en-US)
• Flutter version 1.20.3 at D:\src\flutter
• Framework revision 216dee6 (11 days ago), 2020-09-01 12:24:47 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
....
• No issues found!

изображение

изображение
изображение

@Zazo032
Copy link
Contributor Author

Zazo032 commented Sep 12, 2020

I'll reopen the issue since it has started to happen again, I'm seeing a few reports in Crashlytics

@Zazo032 Zazo032 reopened this Sep 12, 2020
@thechinkysight
Copy link

I am facing these crashes as well.

@zhai3711
Copy link

我也在面临同样的问题

@markusaksli-nc markusaksli-nc added a: build Building flutter applications with the tool a: release Challenges faced when attempting to productionize an app customer: crowd Affects or could affect many people, though not necessarily a specific customer. c: fatal crash Crashes that terminate the process tool Affects the "flutter" command-line tool. See also t: labels. labels Sep 14, 2020
@kw2019ltd
Copy link

kw2019ltd commented Feb 16, 2021 via email

@mkruglikov
Copy link

mkruglikov commented Feb 19, 2021

Just faced the same issue. We're using flutter in existing android app and libflutter.so is not getting generated for x86 when building release apk. So it doesn't work in x86 emulators

build.gradle
...

android {
  compileSdkVersion 29
  buildToolsVersion "29.0.3"
  defaultConfig {
      applicationId '...'
      minSdkVersion 21
      targetSdkVersion 29
      versionCode 33
      versionName "1.0.1"
      multiDexEnabled true
  }

  lintOptions {
      checkReleaseBuilds false
  }

  buildTypes {
      release {
          signingConfig signingConfigs.release
          manifestPlaceholders = [crashlytics: "true"]
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
      }
      debug {
          signingConfig signingConfigs.release
          applicationIdSuffix ".debug"

          ext.alwaysUpdateBuildId = false
          FirebasePerformance {
              instrumentationEnabled false
          }

          crunchPngs false
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
      }
  }

  if (project.hasProperty('devBuild')) {
      splits.abi.enable = false
      splits.density.enable = false
  }

  compileOptions {
      targetCompatibility 1.8
      sourceCompatibility 1.8
  }

  buildFeatures {
      viewBinding true
      dataBinding true
  }
}

...
pubspec.yaml
name: flutter_module
description: ...

version: 1.0.0+1

environment:
sdk: ">=2.10.0 <3.0.0"

dependencies:
flutter:
  sdk: flutter
flutter_bloc: ^6.1.1
super_enum: ^0.5.0
chopper: ^3.0.6
json_annotation: ^3.1.1
shared_preferences: ^0.5.12+4
freezed_annotation: ^0.12.0
rxdart: ^0.25.0
intl: ^0.16.1
cupertino_icons: ^1.0.0

dev_dependencies:
flutter_test:
  sdk: flutter
build_runner: ^1.10.11
super_enum_generator: ^0.6.0
chopper_generator: ^3.0.6
json_serializable: ^3.5.1
freezed: ^0.12.7

flutter:
uses-material-design: true

fonts:
  - family: SanFrancisco
    fonts:
      - asset: fonts/sfui_regular.ttf
      - asset: fonts/sfui_regular_italic.ttf
      - asset: fonts/sfui_semibold.ttf
      - asset: fonts/sfui_medium.ttf
      - asset: fonts/sfui_heavy.ttf

  - family: FlutterIcon
    fonts:
      - asset: images/ttf/FlutterIcon.ttf

module:
  androidX: true
  androidPackage: ...
  iosBundleIdentifier: ...

lib

@MATTYGILO
Copy link

GCE x86 phone is an automated bot testing your app when you upload it to play store. it crashes because its using the x86 architecture which is not supported by flutter. setting the abiFilters as described by #32756 (comment) should fix it.

Hasn't for me. But, I'll try again and get back to you

@ycv005
Copy link

ycv005 commented Feb 28, 2021

I am facing same issue on Google Pixel 3xl and motorola one vision.

I have build my app using this command- flutter build appbundle --no-tree-shake-icons with flutter version- 1.22.6

If Google tech won't work on Google device, then how to deal with it ? (Please have a look) @eseidelGoogle @chinmaygarde @zanderso @TahaTesser

If the error is so common, then it should be mentioned into the release doc or by-default fix should be added. Thanks in advance for the response.

Here are the images of the crashes

image

Another-

image

Note- I did read some similar issues, that suggest of adding few lines in abifilter, but I didn't have those device and mine laptop is that powerful to test the app on emulator.

@abdullah432
Copy link

Same issue

@tgpsantos
Copy link

tgpsantos commented Mar 3, 2021

GCE x86 phone is an automated bot testing your app when you upload it to play store. it crashes because its using the x86 architecture which is not supported by flutter. setting the abiFilters as described by #32756 (comment) should fix it.

The abiFilters solution didn't fix it for me

@karmelcorn
Copy link

karmelcorn commented Mar 4, 2021

I am getting the below crashes on Galaxy A21s device. using Flutter version 1.22.2.

I don't think the A21 is using x86 architecture, so setting the abiFilters probably won't help. Any ideas on what I can do to fix the issue? Thank you.

Where does /lib/arm64, /system/lib64 (from the crash log) refer to?

I checked the apk and libflutter.so is found in armeabi-v7a (ARM 32-bit), arm64-v8a (ARM 64-bit), and x86-64 (x86 64-bit) folders.

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx.xxxx/com.asptest.asp.MainActivity}: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/base.apk", zip file "/data/app/com.xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.af.apk", zip file "/data/app/com.xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.am.apk", zip file "/data/app/com.xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.ar.apk", zip file "/data/app/com.xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.as.apk", zip file "/data/app/com.xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.be.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.bg.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.bn.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.bs.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.ca.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.cs.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.da.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.de.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.el.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.fa.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.fi.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.fr.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.gl.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.hdpi.apk", zip file "/data/app/xxx.xxxx-VeQjSxZf9xkExZLn3s_x3Q==/split_config.hi.apk", zip file "/data/app/cxxx.xxxx<truncated: 3589 chars>
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3623)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3775)
       at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2261)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:8107)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Fatal Exception: java.lang.RuntimeException: Unable to create service io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xxxx.xxxxx-AisdFQgiGgZzovIgVIaVWQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.xxxx.xxxx-AisdFQgiGgZzovIgVIaVWQ==/lib/arm64, /system/lib64]]] couldn't find "libflutter.so"
       at android.app.ActivityThread.handleCreateService(ActivityThread.java:4412)
       at android.app.ActivityThread.access$1700(ActivityThread.java:274)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2118)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:8167)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Caused by java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xxx.xxxx-AisdFQgiGgZzovIgVIaVWQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.xxxx.xxxxxx-AisdFQgiGgZzovIgVIaVWQ==/lib/arm64, /system/lib64]]] couldn't find "libflutter.so"
       at io.flutter.embedding.engine.loader.FlutterLoader.a(FlutterLoader.java:284)
       at io.flutter.view.FlutterMain.a(FlutterMain.java:8)
       at io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.onCreate(FlutterFirebaseMessagingService.java:12)
       at android.app.ActivityThread.handleCreateService(ActivityThread.java:4400)
       at android.app.ActivityThread.access$1700(ActivityThread.java:274)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2118)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:8167)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

Screen Shot 2021-03-04 at 10 16 31 AM

@ycv005
Copy link

ycv005 commented Mar 4, 2021

@karmelcorn what abiFilters did you define, please mention ?

@karmelcorn
Copy link

@karmelcorn what abiFilters did you define, please mention ?

I did not put any abiFilters. I am just building it with flutter build app bundle.

My understanding is that filter is necessary for the app to work on x86 architecture. But I am not concerned with the app crashing on GCE x86 phone (automated bot).

I am not understanding why the app is crashing on the Galaxy A21s device, which should be running 64 bits. Unless I am wrong here and greatly appreciate anyone to correct me.

Thank you.

@kuhnroyal
Copy link

I have seen phones that are x86_64 defaulting to the x86 folder if it is there, dunno why.
And adding the abiFilters from #32756 (comment) prevented that and now it only occurs with GCE x86 sometimes.

@abdullah432
Copy link

I have seen phones that are x86_64 defaulting to the x86 folder if it is there, dunno why.
And adding the abiFilters from #32756 (comment) prevented that and now it only occurs with GCE x86 sometimes.

Application was working on my phone but not on client phone. I add mention line in gradle but still application is crashing on client side. It's now more than a week, still not fixed. Can it be resolved if i move to previous flutter sdk?

@kuhnroyal
Copy link

Figure out what you are building locally and what your are actually deploying (APK vs AppBundle). Then inspect the folders shown above and then download all the different APKs from the Google Play Console and inspect them. There has to be a miss-match somewhere.

@kuhnroyal
Copy link

@karmelcorn That is actually not the Flutter app failing to start but the FlutterFirebaseMessagingService. Maybe try to disable that and see where that leads you. It is odd that it is looking for the lib/arm64 folder in the APK which doesn't seem to exist.

@karmelcorn
Copy link

@karmelcorn That is actually not the Flutter app failing to start but the FlutterFirebaseMessagingService. Maybe try to disable that and see where that leads you. It is odd that it is looking for the lib/arm64 folder in the APK which doesn't seem to exist.

Thank you. I rechecked my logs and I did get a Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo error before the firebasemessage error.

I am starting to wonder if this log is from Google Play store doing the test during the review process? Maybe they are side-loading the app or something?

@sandwichstealer
Copy link

In my case I solved it by typing 'flutter upgrade' in the command line.

@OmarBakry-eg
Copy link

Same issue HERE !!!
I tried ndk { abiFilters 'x86', 'armeabi-v7a' }, flutter clean, uninstall the app and flutter upgrade and nothing change please provide some help

@zjamshidi
Copy link

It's going to be a year with this issue. how we can really fix this?

@zanderso
Copy link
Member

There seem to be a few different issues conflated in this thread. However as @TahaTesser points out, these are likely duplicates of one or more existing issues. (Search closed issues for "UnsatisfiedLinkError".) Please also note that this error may be unrelated to Flutter. See the stackoverflow thread here, and the comment here.

Since this thread has become long and difficult to follow, and because it is likely a duplicate of other issues, I am going to close it. If you have read the links above, and still think you are seeing a problem not covered there, please file a new issue with a reproducible test case. Thanks!

@johnnydevvcodes
Copy link

Why is this closed? Same issue here.

@Coronon
Copy link

Coronon commented May 24, 2021

Fix when seeing crash on emulator

I had this issue on my emulator when trying to runn a release build through the playstore. My emulator is running x86, which is only supported by some of the native libraries I use in my app, therefore it creates ressources for x86 without the Flutter.so (because it is simply not supported [google play lists 5 wearable devices that require x86 out of thousands]). The simulator than picks the ressource most appropriate -> x86 and crashes (the app) because there are libs missing. This is kinda expected behaviour. What you want is to filter out these bad 'abi´s', so that devices have to pick a version Flutter supports. This can be dome using the abiFilter directive in your android/app/build.gradle through adding the following code:

android {
  //...
  defaultConfig {
      //...
      ndk {
          abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
      }
  }
  //...
}

This should fix the problem. You simply have to rerun the fullter build {appbundle/apk} again. To verify the results compare the two builds (apk is easiest) in Android-Studio: Top-Toolbar -> Build -> Apk Analyzer. You will see that in the lib folder, there wont be any unsupported abi´s anymore.

Hope I could help someone :)

@leiiiooo
Copy link

leiiiooo commented Jun 9, 2021

Really strange, I checked the crash version apk, but I found there was a libflutter.so. We build defferent apk, for one is armv7, the other one is armv8. So, I donot think my crash have relationship with defaultConfig , also, I donot know what should do.

@Fauzdar1
Copy link

Faced exactly same issue when generating release build.

But, as mentioned here and as I've experienced, this issue is related to abi filers because I'm using split configuration to generate multiple APKs and none of the split APK works, except of course, the universal build containing all.

splits {
    // Configures multiple APKs based on ABI.
    abi {
        // Enables building multiple APKs per ABI.
        enable true

        // By default all ABIs are included, so use reset() and include to specify that we only
        // want APKs for x86, armeabi-v7a, and mips.
        reset()

        // Specifies a list of ABIs that Gradle should create APKs for.
        include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"

        // Specifies that we want to also generate a universal APK that includes all ABIs.
        universalApk true
    }
}

By using the above code, only the universal build works, and others give Flutter initialization failed error with libflutter.so not found.

@cirediew
Copy link

@Fauzdar1 Check out this: https://flutter.dev/docs/deployment/android#what-are-the-supported-target-architectures

Flutter does not currently support building for x86 Android (See Issue 9253).

@richard457
Copy link

Facing the same issue here too, this needs to be seriously investigated.

@github-actions
Copy link

github-actions bot commented Aug 8, 2021

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 -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: build Building flutter applications with the tool a: production Issues experienced in live production apps a: release Challenges faced when attempting to productionize an app c: fatal crash Crashes that terminate the process customer: crowd Affects or could affect many people, though not necessarily a specific customer. platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels.
Projects
Tools - Android review
  
Engineer reviewed
Development

No branches or pull requests