Not possible to deploy for Android
-
I cannot deploy my app for Android. It just does not build and APK and always gives me this error:
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':processDebugResources'. > Android resource linking failed Output: /home/maydin/Desktop/PROJECTS/Qt/build-AppV2-Android_for_armeabi_v7a_Clang_Qt_5_12_1_for_Android_ARMv72-Debug/android-build/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml:39: error: 'orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density' is incompatible with attribute configChanges (attr) flags [locale=4, fontScale=1073741824, keyboard=16, keyboardHidden=32, layoutDirection=8192, mcc=1, mnc=2, navigation=64, orientation=128, screenLayout=256, screenSize=1024, smallestScreenSize=2048, touchscreen=8, uiMode=512]. error: failed processing manifest. Command: /home/maydin/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.0-4818971-linux.jar/ebd8c363d5b5dfd0111c4ccf701edca0/aapt2-3.2.0-4818971-linux/aapt2 link -I\ /home/maydin/Android/sdk-tools-linux-4333796/platforms/android-21/android.jar\ --manifest\ /home/maydin/Desktop/PROJECTS/Qt/build-AppV2-Android_for_armeabi_v7a_Clang_Qt_5_12_1_for_Android_ARMv72-Debug/android-build/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\ -o\ /home/maydin/Desktop/PROJECTS/Qt/build-AppV2-Android_for_armeabi_v7a_Clang_Qt_5_12_1_for_Android_ARMv72-Debug/android-build/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\ -R\ @/home/maydin/Desktop/PROJECTS/Qt/build-AppV2-Android_for_armeabi_v7a_Clang_Qt_5_12_1_for_Android_ARMv72-Debug/android-build/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ /home/maydin/Desktop/PROJECTS/Qt/build-AppV2-Android_for_armeabi_v7a_Clang_Qt_5_12_1_for_Android_ARMv72-Debug/android-build/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\ --custom-package\ org.qtproject.example.AppV2\ -0\ apk\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.0-4818971-linux Daemon #0 Output: /home/maydin/Desktop/PROJECTS/Qt/build-AppV2-Android_for_armeabi_v7a_Clang_Qt_5_12_1_for_Android_ARMv72-Debug/android-build/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml:39: AAPT: error: 'orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density' is incompatible with attribute configChanges (attr) flags [locale=4, fontScale=1073741824, keyboard=16, keyboardHidden=32, layoutDirection=8192, mcc=1, mnc=2, navigation=64, orientation=128, screenLayout=256, screenSize=1024, smallestScreenSize=2048, touchscreen=8, uiMode=512]. error: failed processing manifest. Command: /home/maydin/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.0-4818971-linux.jar/ebd8c363d5b5dfd0111c4ccf701edca0/aapt2-3.2.0-4818971-linux/aapt2 link -I\ /home/maydin/Android/sdk-tools-linux-4333796/platforms/android-21/android.jar\ --manifest\ /home/maydin/Desktop/PROJECTS/Qt/build-AppV2-Android_for_armeabi_v7a_Clang_Qt_5_12_1_for_Android_ARMv72-Debug/android-build/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\ -o\ 14 actionable tasks: 1 executed, 13 up-to-date /home/maydin/Desktop/PROJECTS/Qt/build-AppV2-Android_for_armeabi_v7a_Clang_Qt_5_12_1_for_Android_ARMv72-Debug/android-build/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\ -R\ @/home/maydin/Desktop/PROJECTS/Qt/build-AppV2-Android_for_armeabi_v7a_Clang_Qt_5_12_1_for_Android_ARMv72-Debug/android-build/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ /home/maydin/Desktop/PROJECTS/Qt/build-AppV2-Android_for_armeabi_v7a_Clang_Qt_5_12_1_for_Android_ARMv72-Debug/android-build/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\ --custom-package\ org.qtproject.example.AppV2\ -0\ apk\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.0-4818971-linux Daemon #0 * Try: Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 10s AAPT2 aapt2-3.2.0-4818971-linux Daemon #0: shutdown VCS Checkout Cache (/home/maydin/Desktop/PROJECTS/Qt/build-AppV2-Android_for_armeabi_v7a_Clang_Qt_5_12_1_for_Android_ARMv72-Debug/android-build/.gradle/vcsWorkingDirs) has not been cleaned up in 0 days Building the android package failed! 10:30:58: The process "/home/maydin/Qt/5.12.1/android_armv7/bin/androiddeployqt" exited with code 14. Error while building/deploying project AppV2 (kit: Android for armeabi-v7a (Clang Qt 5.12.1 for Android ARMv72)) When executing step "Build Android APK"
I removed "|mcc|mnc|density" from Manifest file, cleaned project, tried again but still same error. I am drying to build in debug mode. Also i choose Android-21 for both minimum and target SDK while using android-21 API.
SDK version: 26.1.1
NDK version: 18.1.5063045
Qt version: 12.1 -
Can you post your manifest here? Or at least line 39 and line containing
configChanges
? -
@sierdzio said in Not possible to deploy for Android:
Can you post your manifest here? Or at least line 39 and line containing
configChanges
?- Cleaned project
- Deleted
android
folder in project - Removed related lines from .PRO
- Deleted build folder
- Project Settings -> Create template -> Chosen API 21 for both minimum and target.
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="AppV2" android:screenOrientation="unspecified" android:launchMode="singleTop">
Same error. Then I deleted build folder again and changed only
configchanges
to this:<?xml version="1.0"?> <manifest package="org.qtproject.example.appv2" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1" android:versionCode="1" android:installLocation="auto"> <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="AppV2"> <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="AppV2" android:screenOrientation="unspecified" android:launchMode="singleTop"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> <!-- Application arguments --> <!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ --> <!-- Application arguments --> <meta-data android:name="android.app.lib_name" android:value="AppV2"/> <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/> <meta-data android:name="android.app.repository" android:value="default"/> <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/> <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/> <!-- Deploy Qt libs as part of package --> <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/> <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/> <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/> <!-- Run with local libs --> <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/> <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/> <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/> <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/> <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/> <!-- Used to specify custom system library path to run with local system libs --> <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> --> <!-- Messages maps --> <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/> <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/> <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/> <!-- Messages maps --> <!-- Splash screen --> <!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ --> <!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ --> <!-- Splash screen --> <!-- Background running --> <!-- Warning: changing this value to true may cause unexpected crashes if the application still try to draw after "applicationStateChanged(Qt::ApplicationSuspended)" signal is sent! --> <meta-data android:name="android.app.background_running" android:value="false"/> <!-- Background running --> <!-- auto screen scale factor --> <meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/> <!-- auto screen scale factor --> <!-- extract android style --> <!-- available android:values : * default - In most cases this will be the same as "full", but it can also be something else if needed, e.g., for compatibility reasons * full - useful QWidget & Quick Controls 1 apps * minimal - useful for Quick Controls 2 apps, it is much faster than "full" * none - useful for apps that don't use any of the above Qt modules --> <meta-data android:name="android.app.extract_android_style" android:value="default"/> <!-- extract android style --> </activity> <!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices --> </application> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application. Remove the comment if you do not require these default permissions. --> <!-- %%INSERT_PERMISSIONS --> <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application. Remove the comment if you do not require these default features. --> <!-- %%INSERT_FEATURES --> </manifest>
Now build works. But it doesn't start in my phone now. Here application output:
D/SecurityLogAgent(10563): FileCipher : Destination file name = denialLog-565317820.zip dest file Size 1360 E/Zygote ( 6531): MountEmulatedStorage() E/Zygote ( 6531): v2 I/SELinux ( 6531): Function: selinux_compare_spd_ram, SPD-policy is existed. and_ver=SEPF_GT-I9500_5.0.1-1 ver=51 I/libpersona( 6531): KNOX_SDCARD checking this for 10059 I/libpersona( 6531): KNOX_SDCARD not a persona I/SELinux ( 6531): Function: selinux_compare_spd_ram , priority [1] , priority version is VE=SEPF_GT-I9500_5.0.1-1_0051 E/SELinux ( 6531): [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL I/art ( 6531): Late-enabling -Xcheck:jni I/ActivityManager( 3283): Start proc org.qtproject.example.appv2 for activity org.qtproject.example.appv2/org.qtproject.qt5.android.bindings.QtActivity: pid=6531 uid=10059 gids={50059, 9997, 3003, 1028, 1015, 1023} abi=armeabi-v7a D/ResourcesManager( 6531): creating new AssetManager and set to /data/app/org.qtproject.example.appv2-2/base.apk V/BitmapFactory( 6531): DecodeImagePath(decodeResourceStream3) : res/drawable-xxhdpi-v4/ic_ab_back_holo_light_am.png V/BitmapFactory( 6531): DecodeImagePath(decodeResourceStream3) : res/drawable-xxhdpi-v4/sym_def_app_icon.png I/QtCore ( 6531): Start I/Qt ( 6531): qt started V/BitmapFactory( 6531): DecodeImagePath(decodeResourceStream3) : res/drawable-xxhdpi-v4/scrubber_control_disabled_holo.png V/BitmapFactory( 6531): DecodeImagePath(decodeResourceStream3) : res/drawable-xxhdpi-v4/scrubber_control_pressed_holo.png V/BitmapFactory( 6531): DecodeImagePath(decodeResourceStream3) : res/drawable-xxhdpi-v4/scrubber_control_focused_holo.png V/BitmapFactory( 6531): DecodeImagePath(decodeResourceStream3) : res/drawable-xxhdpi-v4/scrubber_control_normal_holo.png V/BitmapFactory( 6531): DecodeImagePath(decodeResourceStream3) : res/drawable-xxhdpi-v4/text_select_handle_middle.png V/BitmapFactory( 6531): DecodeImagePath(decodeResourceStream3) : res/drawable-xhdpi-v4/btn_check_buttonless_on.png V/BitmapFactory( 6531): DecodeImagePath(decodeResourceStream3) : res/drawable-xhdpi-v4/btn_check_buttonless_off.png D/Activity( 6531): performCreate Call secproduct feature valuefalse D/Activity( 6531): performCreate Call debug elastic valuetrue D/OpenGLRenderer( 6531): Render dirty regions requested: true D/Atlas ( 6531): Validating map... I/OpenGLRenderer( 6531): Initialized EGL, version 1.4 W/OpenGLRenderer( 6531): Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... D/OpenGLRenderer( 6531): Get maximum texture size. GL_MAX_TEXTURE_SIZE is 4096 D/OpenGLRenderer( 6531): Enabling debug mode 0 E/ ( 6531): [android_ws] Format: 5, Width: 1080, Height: 1920 E/ ( 6531): [android_ws] Format: 5, Width: 1080, Height: 1920 E/ ( 6531): [android_ws] Format: 5, Width: 1080, Height: 1920 E/ ( 6531): [android_ws] Format: 5, Width: 1080, Height: 1920 W/System.err( 6531): java.lang.Exception: Can't find main library 'AppV2' W/System.err( 6531): at org.qtproject.qt5.android.QtNative.startApplication(QtNative.java:331) W/System.err( 6531): at org.qtproject.qt5.android.QtActivityDelegate$4.run(QtActivityDelegate.java:730) W/System.err( 6531): at org.qtproject.qt5.android.QtLayout.onSizeChanged(QtLayout.java:77) W/System.err( 6531): at android.view.View.sizeChange(View.java:16803) W/System.err( 6531): at android.view.View.setFrame(View.java:16776) W/System.err( 6531): at android.view.View.layout(View.java:16691) W/System.err( 6531): at android.view.ViewGroup.layout(ViewGroup.java:5328) W/System.err( 6531): at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) W/System.err( 6531): at android.widget.FrameLayout.onLayout(FrameLayout.java:508) W/System.err( 6531): at android.view.View.layout(View.java:16695) W/System.err( 6531): at android.view.ViewGroup.layout(ViewGroup.java:5328) W/System.err( 6531): at com.android.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:494) W/System.err( 6531): at android.view.View.layout(View.java:16695) W/System.err( 6531): at android.view.ViewGroup.layout(ViewGroup.java:5328) W/System.err( 6531): at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) W/System.err( 6531): at android.widget.FrameLayout.onLayout(FrameLayout.java:508) W/System.err( 6531): at android.view.View.layout(View.java:16695) W/System.err( 6531): at android.view.ViewGroup.layout(ViewGroup.java:5328) W/System.err( 6531): at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2319) W/System.err( 6531): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2032) W/System.err( 6531): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191) W/System.err( 6531): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6642) W/System.err( 6531): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777) W/System.err( 6531): at android.view.Choreographer.doCallbacks(Choreographer.java:590) W/System.err( 6531): at android.view.Choreographer.doFrame(Choreographer.java:560) W/System.err( 6531): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763) W/System.err( 6531): at android.os.Handler.handleCallback(Handler.java:739) W/System.err( 6531): at android.os.Handler.dispatchMessage(Handler.java:95) W/System.err( 6531): at android.os.Looper.loop(Looper.java:145) W/System.err( 6531): at android.app.ActivityThread.main(ActivityThread.java:5951) W/System.err( 6531): at java.lang.reflect.Method.invoke(Native Method) W/System.err( 6531): at java.lang.reflect.Method.invoke(Method.java:372) W/System.err( 6531): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) W/System.err( 6531): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195) W/InputMethodManagerService( 3283): Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@3440e7c4 (uid=10059 pid=6531) I/ActivityManager( 3283): Killing 6531:org.qtproject.example.appv2/u0a59 (adj 15): empty #31 "org.qtproject.example.appv2" died.
-
Hm, manifest looks okay. At runtime your main activity is not found, which might mean some missing app template code perhaps (I'm not sure, I haven't seen this error before). But androiddeployqt provides a default template if one is missing in the app code. So, I don't know, sorry.
-
@sierdzio said in Not possible to deploy for Android:
Hm, manifest looks okay. At runtime your main activity is not found, which might mean some missing app template code perhaps (I'm not sure, I haven't seen this error before). But androiddeployqt provides a default template if one is missing in the app code. So, I don't know, sorry.
Well I will try with newer NDK version then.
But I have a question. I used android-21 here but i dont know should I use android-28 and choose both target and minimum to 21 again.
And which version should I select at "target sdk". I dont get the purpose of that.
-
If you are compiling for ARM64, you should definitely use target API 28.
A very general hint:
- target API - always use newest
- minimal API - check which oldest Android version is still quite popular (~10% market share) and choose the corresponding API
I dont get the purpose of that.
Read Android documentation, then.
-
Always run gradlew lint (or gradlew.bat lint on Windows) command in the build directory after any Android-related changes and look into HTML report file produced by this tool. It warns about many potential issues and inconsistencies (manifest issues, API version mismatches, invalid and unused resources, localization issues, general programming errors in your Android-related Java code, obsolete dependencies, and so on, and so on). Very useful.
-
- delete all the folders named "build-xxxxxxx"
- delete ".pro.user" file
- delete "android" folder, but keep the "AndroidManifest.xml" file for further configration
- delete "C:\Users\your usernamexxxxxxx\.gradle" folder, but zip it first for insurance
- make sure installed the correct version of Qt, SDK, NDK
- open the project and create template for android, don't choose copy the gradle, and then modify it by the "AndroidManifest.xml" file you keeped
- make sure your network works well
- start compiling and wait for the latest gradle downloading, it should work