The app runs properly on iOS, but when I try to run it on an android I get the following error
E/FlutterLoader( 9150): Flutter initialization failed.
E/FlutterLoader( 9150): java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
E/FlutterLoader( 9150): at java.util.concurrent.FutureTask.report(FutureTask.java:123)
E/FlutterLoader( 9150): at java.util.concurrent.FutureTask.get(FutureTask.java:193)
E/FlutterLoader( 9150): at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(FlutterLoader.java:178)
E/FlutterLoader( 9150): at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:289)
E/FlutterLoader( 9150): at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:192)
E/FlutterLoader( 9150): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine(FlutterActivityAndFragmentDelegate.java:234)
E/FlutterLoader( 9150): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:154)
E/FlutterLoader( 9150): at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:410)
E/FlutterLoader( 9150): at android.app.Activity.performCreate(Activity.java:8000)
E/FlutterLoader( 9150): at android.app.Activity.performCreate(Activity.java:7984)
E/FlutterLoader( 9150): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
E/FlutterLoader( 9150): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
E/FlutterLoader( 9150): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
E/FlutterLoader( 9150): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
E/FlutterLoader( 9150): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/FlutterLoader( 9150): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/FlutterLoader( 9150): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
E/FlutterLoader( 9150): at android.os.Handler.dispatchMessage(Handler.java:106)
E/FlutterLoader( 9150): at android.os.Looper.loop(Looper.java:223)
E/FlutterLoader( 9150): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/FlutterLoader( 9150): at java.lang.reflect.Method.invoke(Native Method)
E/FlutterLoader( 9150): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/FlutterLoader( 9150): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/FlutterLoader( 9150): Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
E/FlutterLoader( 9150): at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
E/FlutterLoader( 9150): at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
E/FlutterLoader( 9150): at java.lang.System.loadLibrary(System.java:1664)
E/FlutterLoader( 9150): at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:129)
E/FlutterLoader( 9150): at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:123)
E/FlutterLoader( 9150): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/FlutterLoader( 9150): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/FlutterLoader( 9150): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FlutterLoader( 9150): at java.lang.Thread.run(Thread.java:923)
I tried all the fixes suggested in this post, but none of them resolved the problem
And as we can see in the screenshot below, “libreal-jni.so” is present in all sub-folders of “lib”, for all the android device architectures. But, Flutter’s “libflutter.so” was only present under “armeabi-v7a” folder.
Flutter’s build system only includes the libflutter.so for the targeted platform to the final APK. But the App’s native libraries still contain the native libraries for every platform, so when running an APK in compatible mode (64 bit device using 32 bit APK), it’s not able to load Flutter’s native library (as it’s missing).
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.
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)
I uninstall and Clean Project
(By Android Studio). And run again it's work for me.
uninstalling the app on the emulator and restarting the emulator fixed it for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With