I am currently releasing my APKs to the stores and I've encountered a problem where my app wouldn't go further than the splash screen. I initially thought that problems is in how overloaded main() function is but then i got logcat.txt from play market.
The problem:
03-30 10:55:19.813: E/AndroidRuntime(6738): FATAL EXCEPTION: main
03-30 10:55:19.813: E/AndroidRuntime(6738): Process: com.portalapp.portal, PID: 6738
03-30 10:55:19.813: E/AndroidRuntime(6738): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.portalapp.portal/com.portalapp.portal.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-0JLHc7wgxFmUsfRw2mmkng==/base.apk", zip file "/data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/base.apk", zip file "/data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.en.apk", zip file "/data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.x86.apk", zip file "/data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/androidx.test.tools.crawler-0JLHc7wgxFmUsfRw2mmkng==/lib/x86, /data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/lib/x86, /data/app/androidx.test.tools.crawler-0JLHc7wgxFmUsfRw2mmkng==/base.apk!/lib/x86, /data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/base.apk!/lib/x86, /data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.en.apk!/lib/x86, /data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.x86.apk!/lib/x86, /data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.xxhdpi.apk!/lib/x86, /system/lib]]] couldn't find "libflutter.so"
03-30 10:55:19.813: E/AndroidRuntime(6738): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
03-30 10:55:19.813: E/AndroidRuntime(6738): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
03-30 10:55:19.813: E/AndroidRuntime(6738): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
03-30 10:55:19.813: E/AndroidRuntime(6738): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
03-30 10:55:19.813: E/AndroidRuntime(6738): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
03-30 10:55:19.813: E/AndroidRuntime(6738): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
03-30 10:55:19.813: E/AndroidRuntime(6738): at android.os.Handler.dispatchMessage(Handler.java:106)
03-30 10:55:19.813: E/AndroidRuntime(6738): at android.os.Looper.loop(Looper.java:193)
03-30 10:55:19.813: E/AndroidRuntime(6738): at android.app.ActivityThread.main(ActivityThread.java:6669)
03-30 10:55:19.813: E/AndroidRuntime(6738): at java.lang.reflect.Method.invoke(Native Method)
03-30 10:55:19.813: E/AndroidRuntime(6738): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
03-30 10:55:19.813: E/AndroidRuntime(6738): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
03-30 10:55:19.813: E/AndroidRuntime(6738): 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-0JLHc7wgxFmUsfRw2mmkng==/base.apk", zip file "/data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/base.apk", zip file "/data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.en.apk", zip file "/data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.x86.apk", zip file "/data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/androidx.test.tools.crawler-0JLHc7wgxFmUsfRw2mmkng==/lib/x86, /data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/lib/x86, /data/app/androidx.test.tools.crawler-0JLHc7wgxFmUsfRw2mmkng==/base.apk!/lib/x86, /data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/base.apk!/lib/x86, /data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.en.apk!/lib/x86, /data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.x86.apk!/lib/x86, /data/app/com.portalapp.portal-2hUT7KMv3Ptgtpso_o2Pxw==/split_config.xxhdpi.apk!/lib/x86, /system/lib]]] couldn't find "libflutter.so"
03-30 10:55:19.813: E/AndroidRuntime(6738): at bb.f.g(Unknown Source:472)
03-30 10:55:19.813: E/AndroidRuntime(6738): at io.flutter.embedding.engine.a.<init>(Unknown Source:178)
03-30 10:55:19.813: E/AndroidRuntime(6738): at io.flutter.embedding.engine.a.<init>(Unknown Source:12)
03-30 10:55:19.814: E/AndroidRuntime(6738): at io.flutter.embedding.android.c.G(Unknown Source:106)
03-30 10:55:19.814: E/AndroidRuntime(6738): at io.flutter.embedding.android.c.p(Unknown Source:7)
03-30 10:55:19.814: E/AndroidRuntime(6738): at io.flutter.embedding.android.FlutterActivity.onCreate(Unknown Source:13)
03-30 10:55:19.814: E/AndroidRuntime(6738): at android.app.Activity.performCreate(Activity.java:7136)
03-30 10:55:19.814: E/AndroidRuntime(6738): at android.app.Activity.performCreate(Activity.java:7127)
03-30 10:55:19.814: E/AndroidRuntime(6738): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
03-30 10:55:19.814: E/AndroidRuntime(6738): at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:2)
03-30 10:55:19.814: E/AndroidRuntime(6738): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
03-30 10:55:19.814: E/AndroidRuntime(6738): ... 11 more
full logcat.txt is available at my google drive
I tried searching for that exception and I found that this is caused by webview_flutter package on a newer flutter version, so I removed it from my project, removed flutter_html which depends on it, removed all packages that have some connection to a webview at all, but still no result. The up still freezes on a start in most cases.
Here is the list of dependencies in my pubsec.yaml file:
cupertino_icons: ^1.0.2
dynamic_height_grid_view: ^0.0.3
table_calendar: ^3.0.8
flutter_svg: ^2.0.0+1
rive: ^0.10.0
flutter_native_splash: ^2.2.16
flutter_slidable: ^2.0.0
keyboard_dismisser: ^3.0.0
flutter_bloc: ^8.1.1
equatable: ^2.0.5
dio: ^4.0.6
calendar_date_picker2: ^0.3.6
path_provider: ^2.0.11
cron: ^0.5.1
hydrated_bloc: ^9.0.0
blur: ^3.1.0
email_validator: ^2.1.17
flutter_launcher_icons: ^0.11.0
video_player: ^2.5.2
flutter_spinkit: ^5.1.0
audioplayers: ^3.0.1
image_picker: ^0.8.6+1
image_cropper: ^3.0.1
flutter_html: ^3.0.0-alpha.6
url_launcher: ^6.1.8
just_audio: ^0.9.31
audio_video_progress_bar: ^1.0.0
rxdart: ^0.27.7
just_audio_background: ^0.0.1-beta.9
photo_view: ^0.14.0
font_awesome_flutter: ^10.4.0
googleapis: ^10.1.0
googleapis_auth: ^1.3.1
mp3_info: ^0.2.0
fluttertoast: ^8.2.1
firebase_core: ^2.7.0
firebase_analytics: ^10.1.4
flick_video_player: ^0.5.0
webview_flutter: ^4.0.7
firebase_messaging: ^14.2.5
flutter_inappwebview: ^5.7.2+3
overlay_support: ^2.1.0
firebase_in_app_messaging: ^0.7.0+15
firebase_dynamic_links: ^5.0.16
huawei_push: ^6.7.0+300
huawei_analytics: ^6.9.0+302
Any ideas what causing the issue?
Freeze is gone now, here is how I solved this:
Turns out, Firebase wasn't set up correctly, if you have same issue and have Firebase you should check if it is set up correctly.
What was wrong:
for some reason (i'm not the only one working on the project) we had
apply plugin: 'com.google.gms.google-services'
inside android/build.gradle. So I moved it from there to android/app/build.gradle where we apply other plugins such as 'Kotlin-android'
and then inside android/app/build.gradle in the signingConfigs I've added following:
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
so it's like 3 lines of code... Always double check your set ups in situations like this or you might have reputation hit from client like I did /: