Google Play Store "library libflutter.so not found" error
Asked Answered
A

3

8

enter image description hereI am getting this stability issue reported by Google Play store testing on a Wear OS device:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.alsat/com.alsat.MainActivity}: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
Exception java.lang.RuntimeException: Unable to start activity ComponentInfo{com.alsat/com.alsat.MainActivity}: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3449)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3601)
  at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:85)
  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:2066)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:223)
  at android.app.ActivityThread.main (ActivityThread.java:7651)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:592)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:947)
Caused by java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
  at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete (FlutterLoader.java:345)
  at io.flutter.embedding.engine.FlutterEngine.<init> (FlutterEngine.java:327)
  at io.flutter.embedding.engine.FlutterEngine.<init> (FlutterEngine.java:207)
  at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine (FlutterActivityAndFragmentDelegate.java:272)
  at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach (FlutterActivityAndFragmentDelegate.java:181)
  at io.flutter.embedding.android.FlutterActivity.onCreate (FlutterActivity.java:495)
  at android.app.Activity.performCreate (Activity.java:7998)
  at android.app.Activity.performCreate (Activity.java:7978)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1309)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3422)
Caused by java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
  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 (FlutterLoader.java:239)
Caused by java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found
  at java.lang.Runtime.loadLibrary0 (Runtime.java:1087)
  at java.lang.Runtime.loadLibrary0 (Runtime.java:1008)
  at java.lang.System.loadLibrary (System.java:1664)
  at io.flutter.embedding.engine.FlutterJNI.loadLibrary (FlutterJNI.java:141)
  at io.flutter.embedding.engine.loader.FlutterLoader$1.call (FlutterLoader.java:189)
  at io.flutter.embedding.engine.loader.FlutterLoader$1.call (FlutterLoader.java:182)
  at java.util.concurrent.FutureTask.run (FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:923)
Auscultation answered 26/3, 2023 at 13:0 Comment(0)
F
10

Consider using the abiFilters Android Gradle Plugin API to limit the supported architectures in your APK. Doing this avoids a missing libflutter.so runtime crash, for example:

android {
  //...
  defaultConfig {
    ndk {
      // Filter for architectures supported by Flutter.
      abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
    }
  }
}

The Flutter engine has an x86 and x86_64 version. When using an emulator in debug Just-In-Time (JIT) mode, the Flutter module still runs correctly.

Reference: https://docs.flutter.dev/add-to-app/android/project-setup

Forehand answered 25/5, 2023 at 12:25 Comment(1)
Cheers mate, life-saver! Would be great if the flutter would include that crucial part in their android deployment guide docs.flutter.dev/deployment/android instead of on docs.flutter.dev/add-to-app/android/project-setup !!Cookbook
A
5

I fixed this issue by adding the following abiFilters to android/app/build.gradle like so:

 defaultConfig {
    applicationId "com.your-project-name"
    minSdkVersion 24
    targetSdkVersion 33        
    ndk {
        abiFilters 'arm64-v8a', 'armeabi-v7a'
    }
}

and the following:

 buildTypes {
   release {
       signingConfig signingConfigs.release
        ndk {
            abiFilters 'arm64-v8a', 'armeabi-v7a'
        }
   }

}

It also helps to run flutter upgrade and flutter clean before you make your release build for the playstore.

Austrasia answered 27/3, 2023 at 3:42 Comment(2)
Thank you so much, I did it and then published. Thanks again bro🙏Auscultation
That's not accurate: When building your application in release mode, Flutter apps can be compiled for armeabi-v7a (ARM 32-bit), arm64-v8a (ARM 64-bit), and x86-64 (x86 64-bit). Flutter supports building for x86 Android through ARM emulation. docs.flutter.dev/deployment/….Fluorocarbon
C
0

Google Play Store libflutter.so not found solution

buildTypes {
   release {
       signingConfig signingConfigs.release
       ndk {
            abiFilters 'arm64-v8a', 'armeabi-v7a'
        }
   }

}

Caseose answered 15/2 at 10:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.