Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter - couldn't find "libflutter.so"

Tags:

flutter

dart

Trying to publish a flutter app to Play Store, it publishes fine, and also they provided screenshots of the app working on several devices, however, I get this error:

couldn't find "libflutter.so"

Stack Trace:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.luna.chinesetopinyin/com.luna.chinesetopinyin.MainActivity}: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/system/framework/android.test.mock.jar", zip file "/data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/base.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/base.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.en.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.x86.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/lib/x86, /data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/base.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/base.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.en.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.x86.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.xxhdpi.apk!/lib/x86, /system/lib]]] couldn't find "libflutter.so"

Expanded Stack Track:

Exception java.lang.RuntimeException: Unable to start activity ComponentInfo{com.luna.chinesetopinyin/com.luna.chinesetopinyin.MainActivity}: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/system/framework/android.test.mock.jar", zip file "/data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/base.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/base.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.en.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.x86.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/lib/x86, /data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/base.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/base.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.en.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.x86.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.xxhdpi.apk!/lib/x86, /system/lib]]] couldn't find "libflutter.so"
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2913)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3048)
  at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:78)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:108)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:68)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1808)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:193)
  at android.app.ActivityThread.main (ActivityThread.java:6669)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:858)
Caused by java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/system/framework/android.test.mock.jar", zip file "/data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/base.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/base.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.en.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.x86.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/lib/x86, /data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/base.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/base.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.en.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.x86.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.xxhdpi.apk!/lib/x86, /system/lib]]] couldn't find "libflutter.so"
  at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete (FlutterLoader.java)
  at io.flutter.embedding.engine.FlutterEngineGroup.<init> (FlutterEngineGroup.java)
  at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine (FlutterActivityAndFragmentDelegate.java)
  at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach (FlutterActivityAndFragmentDelegate.java)
  at io.flutter.embedding.android.FlutterActivity.onCreate (FlutterActivity.java)
  at android.app.Activity.performCreate (Activity.java:7136)
  at android.app.Activity.performCreate (Activity.java:7127)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1271)
  at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate (MonitoringInstrumentation.java:2)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2893)
Caused by java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/system/framework/android.test.mock.jar", zip file "/data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/base.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/base.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.en.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.x86.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/lib/x86, /data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/base.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/base.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.en.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.x86.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.xxhdpi.apk!/lib/x86, /system/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 (FlutterLoader.java)
Caused by java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/system/framework/android.test.mock.jar", zip file "/data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/base.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/base.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.en.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.x86.apk", zip file "/data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/lib/x86, /data/app/androidx.test.tools.crawler-upCIL-fUxIc3mK8nhXTrOQ==/base.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/base.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.en.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.x86.apk!/lib/x86, /data/app/com.luna.chinesetopinyin-d2I0wNjby5VryoZY_G7GXA==/split_config.xxhdpi.apk!/lib/x86, /system/lib]]] couldn't find "libflutter.so"
  at java.lang.Runtime.loadLibrary0 (Runtime.java:1012)
  at java.lang.System.loadLibrary (System.java:1669)
  at io.flutter.embedding.engine.FlutterJNI.loadLibrary (FlutterJNI.java)
  at io.flutter.embedding.engine.loader.FlutterLoader$1.call (FlutterLoader.java)
  at io.flutter.embedding.engine.loader.FlutterLoader$1.call (FlutterLoader.java)
  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:764)

Alot of resources I find reccomend changing my build.gradle, however, I cant find any configuration to my build.gradle that will fix this:

plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

   def keystoreProperties = new Properties()
   def keystorePropertiesFile = rootProject.file('key.properties')
   if (keystorePropertiesFile.exists()) {
       keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
   }

   android {
    namespace "com.luna.chinesetopinyin"
    compileSdkVersion 33
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        applicationId "com.luna.chinesetopinyin"
        minSdkVersion 21
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64', 'x86'
        }
    }

   signingConfigs {
       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
       }
   }
   buildTypes {
       release {
           signingConfig signingConfigs.release
       }
   }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.work:work-runtime-ktx:2.7.0'
}

Adding ndk stuff:

        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64', 'x86'
        }

Flutter upgrade in terminal

Upgrading all package imports in pubspec.yaml to most up to date version

like image 419
EwanCharalambides Avatar asked Feb 05 '26 11:02

EwanCharalambides


1 Answers

Flutter is not supported on x86 devices.

In following line:

ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64', 'x86'
        }

remove x86 and publish the app update.

From the official doc, https://docs.flutter.dev/deployment/android#what-are-the-supported-target-architectures

the x86 is now supported with arm emulation. There are only a few devices with x86 arch. You can skip them.

like image 194
Rahul Avatar answered Feb 08 '26 01:02

Rahul



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!