Solved Fatal Error when deploying Android app via Google Play or bundletool
-
Hello everybody,
when I bundle my app through QtCreator and let Qt deploy the app on my target device everything works fine. However, when uploading the .aab file to Google Play and testing the resulting .apk or when using the bundletool to check how the resulting apk looks like I get the following error:
"Your application encountered a fatal error and cannot coninue."
This error appears for e.g. Xiaomi Mi 8 (Android Version 9 / API 28) but not for Huawei P9 lite (Android Version 6 / API 23 ). For the latter the app works as expected.
My specifications are:
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
Looking at the log of the Xiaomi device when the deployment failes I get the following issues for the .so files:
Qt JAVA : Can't find 'nulllibc++_shared.so' Qt JAVA : Can't find 'nulllibQt5Core_armeabi-v7a.so' Qt JAVA : Can't find 'nulllibQt5AndroidExtras_armeabi-v7a.so' Qt JAVA : Can't find 'nulllibQt5Gui_armeabi-v7a.so' Qt JAVA : Can't find 'nulllibQt5Network_armeabi-v7a.so' ...
and the stacktrace of the thrown exception is
03-16 18:24:54.260 17383 17383 W System.err: java.lang.reflect.InvocationTargetException 03-16 18:24:54.260 17383 17383 W System.err: at java.lang.reflect.Method.invoke(Native Method) 03-16 18:24:54.260 17383 17383 W System.err: at org.qtproject.qt5.android.bindings.QtLoader.loadApplication(QtLoader.java:267) 03-16 18:24:54.260 17383 17383 W System.err: at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:505) 03-16 18:24:54.260 17383 17383 W System.err: at org.qtproject.qt5.android.bindings.QtActivityLoader.onCreate(QtActivityLoader.java:166) 03-16 18:24:54.260 17383 17383 W System.err: at org.qtproject.qt5.android.bindings.QtActivity.onCreateHook(QtActivity.java:266) 03-16 18:24:54.260 17383 17383 W System.err: at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:273) 03-16 18:24:54.260 17383 17383 W System.err: at android.app.Activity.performCreate(Activity.java:7224) 03-16 18:24:54.260 17383 17383 W System.err: at android.app.Activity.performCreate(Activity.java:7213) 03-16 18:24:54.260 17383 17383 W System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272) 03-16 18:24:54.260 17383 17383 W System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926) 03-16 18:24:54.260 17383 17383 W System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081) 03-16 18:24:54.260 17383 17383 W System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 03-16 18:24:54.260 17383 17383 W System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 03-16 18:24:54.260 17383 17383 W System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 03-16 18:24:54.260 17383 17383 W System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831) 03-16 18:24:54.260 17383 17383 W System.err: at android.os.Handler.dispatchMessage(Handler.java:106) 03-16 18:24:54.260 17383 17383 W System.err: at android.os.Looper.loop(Looper.java:201) 03-16 18:24:54.260 17383 17383 W System.err: at android.app.ActivityThread.main(ActivityThread.java:6806) 03-16 18:24:54.260 17383 17383 W System.err: at java.lang.reflect.Method.invoke(Native Method) 03-16 18:24:54.260 17383 17383 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) 03-16 18:24:54.261 17383 17383 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) 03-16 18:24:54.261 17383 17383 W System.err: Caused by: java.lang.UnsatisfiedLinkError: No implementation found for int[] org.qtproject.qt5.android.ExtractStyle.extractNativeChunkInfo20(long) (tried Java_org_qtproject_qt5_android_ExtractStyle_extractNativeChunkInfo20 and Java_org_qtproject_qt5_android_ExtractStyle_extractNativeChunkInfo20__J) 03-16 18:24:54.261 17383 17383 W System.err: at org.qtproject.qt5.android.ExtractStyle.extractNativeChunkInfo20(Native Method) 03-16 18:24:54.261 17383 17383 W System.err: at org.qtproject.qt5.android.ExtractStyle.findPatchesMarings(ExtractStyle.java:796) 03-16 18:24:54.261 17383 17383 W System.err: at org.qtproject.qt5.android.ExtractStyle.getDrawable(ExtractStyle.java:1130) 03-16 18:24:54.261 17383 17383 W System.err: at org.qtproject.qt5.android.ExtractStyle.extractViewInformations(ExtractStyle.java:1234) 03-16 18:24:54.261 17383 17383 W System.err: at org.qtproject.qt5.android.ExtractStyle.extractTextAppearanceInformations(ExtractStyle.java:1327) 03-16 18:24:54.261 17383 17383 W System.err: at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:2003) 03-16 18:24:54.261 17383 17383 W System.err: at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:614) 03-16 18:24:54.261 17383 17383 W System.err: ... 21 more
Thanks in advance for any clues.
-
I found a few bug reports related to my issue. In particular:
QTBUG-80766EDIT: According to patches mentioned in the bug report, I created a gradle.properties file in the directory ANDROID_PACKAGE_SOURCE_DIR with all the Information Qt usually writes to this file and additionally the key-value pair
android.bundle.enableUncompressedNativeLibs=false
This solved the issue - at least for those devices I tested so far.
Thus, I mark this post as solved.