Reputation: 191
I use VSCode to code my Flutter App. I deployed it to Google Play Store, but the pre-launch report shows that it is crashing on a special device: Google Pixel 2 (virtual), 1080x1920, Android 9 (SDK 28), armeabi, en_US I configured that device and tested it, and it did not crash. I don't understand the report. I need help to relate the report with the Dart/Flutter code. Here is the report. Please help!!
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)
Upvotes: 5
Views: 2284
Reputation: 7952
I think you have a typo in your description of the Google Pixel 2 (virtual)
device used by the playstore, as your dalvik.system.PathClassLoader
shows various x86
apk/libs in the path lists, and I've also seen this myself in the Play Store, but that it shows x86
for the ABI used by the virtual Pixel 2.
Basically the problem is that Flutter does not support the x86 (32 bit) architecture: https://docs.flutter.dev/deployment/android#what-are-the-supported-target-architectures, which stems in part from Dart compiler limitations (https://github.com/flutter/flutter/issues/9253). And even devices that try to do some sort of NDK Translation to run 64 bit apps on 32 bit devices may crash. Debug builds may work because Flutter "supports running the app compiled just in time (JIT) on this architecture", which is probably what you experienced. You can ignore this particular report and still publish your app. But if the prelaunch crash report bothers people, you can also try explicitly adding abiFilters
to your app's build.gradle restricting things as suggested in various more-or-less duplicate issues such as this, so Play Store testing doesn't try to run on the old arch:
android {
defaultConfig {
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}
}
}
For more info see https://github.com/flutter/flutter/issues/37396#issuecomment-1207203921:
Flutter does support x86 64 bit release builds compiled ahead of time (AOT).
Flutter does NOT support x86 32 bit release builds compiled ahead of time, only supports running the app compiled just in time (JIT) on this architecture. This means, you cannot generate a Flutter release build targeting an x86 32 bit device, but you can still run debug builds on them.
It is very important to mention that this issue is for x86 32 bits. x86 64 bit is perfectly fine.
Thankfully, Android devices that run on an x86 32 bit CPUs are almost non-existent. However, Google Play uses an emulator image using x86 32 bit architecture to perform the Pre-launch reports.
The Android OS tries to run an x86 64 bit in an x86 32 bit device by doing a native-level translation, which eventually crashes.
This issue does NOT prevent you from publishing your app, you can ignore the pre-launch report and publish your app to production.
However, I don't believe Google Play is 100% at fault here. Instead, the issue is in the Android OS and their NDK Translation mechanism to run 64 bit apps on 32 bit devices, which is the root of the problem here.
Upvotes: 8
Reputation: 191
@NdegwaJulius Thank you. This fixed my issue! You don't even have to add ndk filter. Do the following in order:
NOTE: defaultConfig {
applicationId "com.company.name"
minSdkVersion 21
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
Upvotes: 0