Tag Archives: flutter Run Error

[Easy Solution] flutter Run Error: library “libflutter.so“ not found

Error log

E/FlutterLoader(20717): java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
E/FlutterLoader(20717): 	at java.util.concurrent.FutureTask.report(FutureTask.java:123)
E/FlutterLoader(20717): 	at java.util.concurrent.FutureTask.get(FutureTask.java:193)
E/FlutterLoader(20717): 	at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(FlutterLoader.java:223)
E/FlutterLoader(20717): 	at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:327)
E/FlutterLoader(20717): 	at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:207)
E/FlutterLoader(20717): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine(FlutterActivityAndFragmentDelegate.java:265)
E/FlutterLoader(20717): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:174)
E/FlutterLoader(20717): 	at io.flutter.embedding.android.FlutterFragment.onAttach(FlutterFragment.java:743)
E/FlutterLoader(20717): 	at androidx.fragment.app.Fragment.performAttach(Fragment.java:2922)
E/FlutterLoader(20717): 	at androidx.fragment.app.FragmentStateManager.attach(FragmentStateManager.java:464)
E/FlutterLoader(20717): 	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:275)
E/FlutterLoader(20717): 	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
E/FlutterLoader(20717): 	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
E/FlutterLoader(20717): 	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
E/FlutterLoader(20717): 	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3138)
E/FlutterLoader(20717): 	at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
E/FlutterLoader(20717): 	at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
E/FlutterLoader(20717): 	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
E/FlutterLoader(20717): 	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1435)
E/FlutterLoader(20717): 	at android.app.Activity.performStart(Activity.java:8024)
E/FlutterLoader(20717): 	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3475)
E/FlutterLoader(20717): 	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
E/FlutterLoader(20717): 	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
E/FlutterLoader(20717): 	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
E/FlutterLoader(20717): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
E/FlutterLoader(20717): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
E/FlutterLoader(20717): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/FlutterLoader(20717): 	at android.os.Looper.loop(Looper.java:223)
E/FlutterLoader(20717): 	at android.app.ActivityThread.main(ActivityThread.java:7656)
E/FlutterLoader(20717): 	at java.lang.reflect.Method.invoke(Native Method)
E/FlutterLoader(20717): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/FlutterLoader(20717): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/FlutterLoader(20717): Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
E/FlutterLoader(20717): 	at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
E/FlutterLoader(20717): 	at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
E/FlutterLoader(20717): 	at java.lang.System.loadLibrary(System.java:1664)
E/FlutterLoader(20717): 	at io.flutter.embedding.engine.FlutterJNI.loadLibrary(FlutterJNI.java:141)
E/FlutterLoader(20717): 	at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:174)
E/FlutterLoader(20717): 	at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:166)
E/FlutterLoader(20717): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/FlutterLoader(20717): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/FlutterLoader(20717): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FlutterLoader(20717): 	at java.lang.Thread.run(Thread.java:923)
E/AndroidRuntime(20717): FATAL EXCEPTION: main
E/AndroidRuntime(20717): Process: surf.jetstream.android, PID: 20717
E/AndroidRuntime(20717): java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
E/AndroidRuntime(20717): 	at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(FlutterLoader.java:315)
E/AndroidRuntime(20717): 	at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:327)
E/AndroidRuntime(20717): 	at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:207)
E/AndroidRuntime(20717): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine(FlutterActivityAndFragmentDelegate.java:265)
E/AndroidRuntime(20717): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:174)
E/AndroidRuntime(20717): 	at io.flutter.embedding.android.FlutterFragment.onAttach(FlutterFragment.java:743)
E/AndroidRuntime(20717): 	at androidx.fragment.app.Fragment.performAttach(Fragment.java:2922)
E/AndroidRuntime(20717): 	at androidx.fragment.app.FragmentStateManager.attach(FragmentStateManager.java:464)
E/AndroidRuntime(20717): 	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:275)
E/AndroidRuntime(20717): 	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
E/AndroidRuntime(20717): 	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
E/AndroidRuntime(20717): 	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
E/AndroidRuntime(20717): 	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3138)
E/AndroidRuntime(20717): 	at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
E/AndroidRuntime(20717): 	at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
E/AndroidRuntime(20717): 	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
E/AndroidRuntime(20717): 	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1435)
E/AndroidRuntime(20717): 	at android.app.Activity.performStart(Activity.java:8024)
E/AndroidRuntime(20717): 	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3475)
E/AndroidRuntime(20717): 	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
E/AndroidRuntime(20717): 	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
E/AndroidRuntime(20717): 	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
E/AndroidRuntime(20717): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
E/AndroidRuntime(20717): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
E/AndroidRuntime(20717): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(20717): 	at android.os.Looper.loop(Looper.java:223)
E/AndroidRuntime(20717): 	at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime(20717): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(20717): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime(20717): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/AndroidRuntime(20717): Caused by: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
E/AndroidRuntime(20717): 	at java.util.concurrent.FutureTask.report(FutureTask.java:123)
E/AndroidRuntime(20717): 	at java.util.concurrent.FutureTask.get(FutureTask.java:193)
E/AndroidRuntime(20717): 	at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(FlutterLoader.java:223)
E/AndroidRuntime(20717): 	... 29 more
E/AndroidRuntime(20717): Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
E/AndroidRuntime(20717): 	at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
E/AndroidRuntime(20717): 	at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
E/AndroidRuntime(20717): 	at java.lang.System.loadLibrary(System.java:1664)
E/AndroidRuntime(20717): 	at io.flutter.embedding.engine.FlutterJNI.loadLibrary(FlutterJNI.java:141)
E/AndroidRuntime(20717): 	at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:174)
E/AndroidRuntime(20717): 	at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:166)
E/AndroidRuntime(20717): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(20717): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(20717): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(20717): 	at java.lang.Thread.run(Thread.java:923)

In fact, it’s caused by the introduction of adaptation errors when the emulator or the real machine is running.
The easiest way to fix it:

        buildTypes {
            release {
                ndk {
                    abiFilters "armeabi",  "arm64-v8a", "armeabi-v7a"
                }
            }
            debug {
                ndk { //Here to add, otherwise the debug package will be a problem, the last three are optional, x86 recommended to add or part of the simulator returns error
                    abiFilters "armeabi",  "armeabi-v7a" , "arm64-v8a" , "x86"
                }
            }
        }