Google Play预启动崩溃分析:Flutter应用libflutter.so缺失问题
Flutter应用Google Play预启动报告崩溃分析(libflutter.so缺失)
问题核心
你的应用在Google Play预启动测试的x86架构虚拟设备(Google Pixel 2,Android 9)上启动崩溃,根因是系统找不到libflutter.so库。本地测试同款设备无问题,大概率是打包发布时的架构配置遗漏了x86支持,导致Play分发的APK中缺少对应架构的so库。
崩溃报告关键信息
FATAL EXCEPTION: main Process: com.outafire.myevents, PID: 6669 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.outafire.myevents/com.outafire.myevents.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-xZ2vnr4Jb8_kw2Er9oP3ag==/base.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/base.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.en.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.x86.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/androidx.test.tools.crawler-xZ2vnr4Jb8_kw2Er9oP3ag==/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/lib/x86, /data/app/androidx.test.tools.crawler-xZ2vnr4Jb8_kw2Er9oP3ag==/base.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/base.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.en.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.x86.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.xxhdpi.apk!/lib/x86, /system/lib, /system/vendor/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(Native Method) 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-xZ2vnr4Jb8_kw2Er9oP3ag==/base.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/base.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.en.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.x86.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/androidx.test.tools.crawler-xZ2vnr4Jb8_kw2Er9oP3ag==/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/lib/x86, /data/app/androidx.test.tools.crawler-xZ2vnr4Jb8_kw2Er9oP3ag==/base.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/base.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.en.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.x86.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.xxhdpi.apk!/lib/x86, /system/lib, /system/vendor/lib]]] couldn't find "libflutter.so" at x6.f.g(Unknown Source:457) at io.flutter.embedding.engine.a.<init>(Unknown Source:184) at io.flutter.embedding.engine.a.<init>(Unknown Source:12) at io.flutter.embedding.android.e.G(Unknown Source:106) at io.flutter.embedding.android.e.p(Unknown Source:7) at io.flutter.embedding.android.d.onCreate(Unknown Source:13) 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) ... 11 more 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-xZ2vnr4Jb8_kw2Er9oP3ag==/base.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/base.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.en.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.x86.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/androidx.test.tools.crawler-xZ2vnr4Jb8_kw2Er9oP3ag==/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/lib/x86, /data/app/androidx.test.tools.crawler-xZ2vnr4Jb8_kw2Er9oP3ag==/base.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/base.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.en.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.x86.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.xxhdpi.apk!/lib/x86, /system/lib, /system/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 x6.f.g(Unknown Source:28) ... 21 more 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-xZ2vnr4Jb8_kw2Er9oP3ag==/base.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/base.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.en.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.x86.apk", zip file "/data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/androidx.test.tools.crawler-xZ2vnr4Jb8_kw2Er9oP3ag==/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/lib/x86, /data/app/androidx.test.tools.crawler-xZ2vnr4Jb8_kw2Er9oP3ag==/base.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/base.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.en.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.x86.apk!/lib/x86, /data/app/com.outafire.myevents-dsiaYFQFA3lGhBlIANSrDQ==/split_config.xxhdpi.apk!/lib/x86, /system/lib, /system/vendor/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(Unknown Source:13) at x6.f$a.b(Unknown Source:18) at x6.f$a.call(Unknown Source:0) 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)
解决方案
调整Android打包架构配置:打开
android/app/build.gradle,在android.defaultConfig下添加或修改ndk配置,确保包含x86架构:defaultConfig { // 其他配置 ndk { abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' } }如果之前设置了过滤且遗漏x86,补充进去;若没有设置,直接添加上述代码。
检查Play Console发布配置:如果使用App Bundle发布,确认是否开启了"按ABI拆分APK"。若开启,Play会给不同架构设备分发对应APK,若打包时没包含x86的so库,x86设备就会崩溃。可以在Play Console的"发布设置"中调整拆分规则,或者暂时禁用ABI拆分(不推荐长期使用,会增大APK体积)。
本地复现x86 Release版本测试:本地测试用debug版本可能不会触发该问题,需打包x86架构的release版本测试:
- 启动x86架构的Google Pixel 2模拟器(Android 9)
- 执行命令:
flutter build apk --release --target-platform android-x86 - 将生成的APK安装到模拟器,验证是否崩溃
清理缓存后重新打包:执行以下命令清理Flutter缓存,避免旧配置影响:
flutter clean flutter pub get flutter build appbundle --release # 或build apk
内容的提问来源于stack exchange,提问作者Carlton Foster
相关产品推荐
相关产品推荐

