【问题标题】:Please Interpret the Google Play Pre-launch Crashes and ANRs Report Details请解读 Google Play 发布前崩溃和 ANR 报告的详细信息
【发布时间】:2023-01-03 14:55:37
【问题描述】:

我使用 VSCode 编写我的 Flutter 应用程序。我将其部署到 Google Play 商店,但启动前报告显示它在特殊设备上崩溃: Google Pixel 2(虚拟),1080x1920,Android 9 (SDK 28),armeabi,en_US 我配置了那个设备并对其进行了测试,它没有崩溃。我不明白这个报告。我需要帮助将报告与 Dart/Flutter 代码相关联。这是报告。请帮忙!!

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)

【问题讨论】:

标签: java flutter dart crash


【解决方案1】:

@NdegwaJulius 谢谢。这解决了我的问题!您甚至不必添加 ndk 过滤器。 按顺序执行以下操作:

  1. flutter 通道测试版
  2. flutter升级3.1.0
  3. 扑干净
  4. flutter build appbundle --release

    笔记: 默认配置{

    applicationId "com.company.name"

    minSdkVersion 21

    targetSdk版本 31

    版本代码 flutterVersionCode.toInteger()

    版本名称 flutterVersionName

    multiDexEnabled 真

    }

【讨论】:

    【解决方案2】:

    我认为您对 playstore 使用的 Google Pixel 2 (virtual) 设备的描述有错别字,因为您的 dalvik.system.PathClassLoader 在路径列表中显示了各种 x86 apk/libs,我自己也在 Play 商店中看到了这个,但对于虚拟 Pixel 2 使用的 ABI,它显示 x86

    基本上问题是 Flutter 不支持 x86(32 位)架构: https://docs.flutter.dev/deployment/android#what-are-the-supported-target-architectures,部分源于 Dart 编译器的限制 (https://github.com/flutter/flutter/issues/9253)。甚至尝试执行某种 NDK 转换以在 32 位设备上运行 64 位应用程序的设备也可能会崩溃。调试构建可能会起作用,因为 Flutter“支持在此架构上运行即时编译 (JIT) 的应用程序”,这可能是您所经历的。您可以忽略此特定报告并仍然发布您的应用程序。但是,如果启动前崩溃报告让人们感到困扰,您也可以尝试将 abiFilters 显式添加到您的应用程序的 build.gradle 中,按照各种或多或少重复的 issues such as this 中的建议限制内容,因此 Play 商店测试不会尝试运行在旧拱门上:

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

    有关详细信息,请参阅https://github.com/flutter/flutter/issues/37396#issuecomment-1207203921

    Flutter 确实支持提前编译的 x86 64 位发布版本 (AOT)。

    Flutter 不支持提前编译的 x86 32 位发布版本 时间,只支持运行即时编译(JIT)的应用程序 这个架构。这意味着,您无法生成 Flutter 版本 针对 x86 32 位设备构建,但您仍然可以运行调试 建立在他们之上。

    非常重要的一点是,这个问题是针对 x86 32 位的。 x86 64 位完全没问题。

    值得庆幸的是,在 x86 32 位 CPU 上运行的 Android 设备几乎 不存在的。但是,Google Play 使用 x86 32 的模拟器图像 位架构来执行预发布报告。

    Android 操作系统尝试通过以下方式在 x86 32 位设备中运行 x86 64 位 进行本地级别的翻译,最终崩溃。

    此问题不会阻止您发布您的应用程序,您可以 忽略发布前报告并将您的应用程序发布到生产环境。

    但是,我不认为 Google Play 在这里 100% 有过错。反而, 问题出在 Android 操作系统及其 NDK 翻译机制中 在 32 位设备上运行 64 位应用程序,这是问题的根源 这里。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-18
      • 2021-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多