Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

A linking error when building the APK file of a QML app



  • I use Qt 5.12 on a Windows 7 X64 machine and below is the Devices on Qt Creator 4.8:

    0_1545988757297_2.PNG

    As it's shown, SDK, NDK and JDK seem to be fine.

    Through this path, I went to create a simple QML project called "test_1":

    File => New File or Project => Application (template) => Qt Quick Application - Empty => The project name (Test_1) => (Build System) qmake => Minimal Required Qt Version 5.12 => Kits (Android X86, Arm7 and Desktop) => Finish

    And here's the code:

    0_1545989216296_3.PNG

    The SDK packages are also as follows:

    0_1545992589111_1.PNG

    Is there something faulty up to here?

    Now testing the program using the kits:
    Desktop: OK
    Android X86 or Arm7 : Faild

    Here's all contents of the Compile Output window in the red colour:

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':processDebugResources'.
    > Android resource linking failed Output: C:\Users\Abbasi\Desktop\Q_Apps\QML_Apps\Test_1\build-Test_1-Android_for_armeabi_v7a_Clang_Qt_5_12_0_for_Android_ARMv7-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: C:\Users\Abbasi\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\83adb1c826b3da76392f22b7ff050e9c\aapt2-3.2.0-4818971-windows\aapt2.exe link -I\ C:\Users\Abbasi\AppData\Local\Android\sdk\platforms\android-21\android.jar\ --manifest\ C:\Users\Abbasi\Desktop\Q_Apps\QML_Apps\Test_1\build-Test_1-Android_for_armeabi_v7a_Clang_Qt_5_12_0_for_Android_ARMv7-Debug\android-build\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\ -o\ C:\Users\Abbasi\Desktop\Q_Apps\QML_Apps\Test_1\build-Test_1-Android_for_armeabi_v7a_Clang_Qt_5_12_0_for_Android_ARMv7-Debug\android-build\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ @C:\Users\Abbasi\Desktop\Q_Apps\QML_Apps\Test_1\build-Test_1-Android_for_armeabi_v7a_Clang_Qt_5_12_0_for_Android_ARMv7-Debug\android-build\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ C:\Users\Abbasi\Desktop\Q_Apps\QML_Apps\Test_1\build-Test_1-Android_for_armeabi_v7a_Clang_Qt_5_12_0_for_Android_ARMv7-Debug\android-build\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\ --custom-package\ org.qtproject.example.Test_1\ -0\ apk\ --no-version-vectors
    Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
    Output: C:\Users\Abbasi\Desktop\Q_Apps\QML_Apps\Test_1\build-Test_1-Android_for_armeabi_v7a_Clang_Qt_5_12_0_for_Android_ARMv7-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: C:\Users\Abbasi\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\83adb1c826b3da76392f22b7ff050e9c\aapt2-3.2.0-4818971-windows\aapt2.exe link -I\ C:\Users\Abbasi\AppData\Local\Android\sdk\platforms\android-21\android.jar\ --manifest\ C:\Users\Abbasi\Desktop\Q_Apps\QML_Apps\Test_1\build-Test_1-Android_for_armeabi_v7a_Clang_Qt_5_12_0_for_Android_ARMv7-Debug\android-build\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\ -o\ C:\Users\Abbasi\Desktop\Q_Apps\QML_Apps\Test_1\build-Test_1-Android_for_armeabi_v7a_Clang_Qt_5_12_0_for_Android_ARMv7-Debug\android-build\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ @C:\Users\Abbasi\Desktop\Q_Apps\QML_Apps\Test_1\build-Test_1-Android_for_armeabi_v7a_Clang_Qt_5_12_0_for_Android_ARMv7-Debug\android-build\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ C:\Users\Abbasi\Desktop\Q_Apps\QML_Apps\Test_1\build-Test_1-Android_for_armeabi_v7a_Clang_Qt_5_12_0_for_Android_ARMv7-Debug\android-build\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\ --custom-package\ org.qtproject.example.Test_1\ -0\ apk\ --no-version-vectors
    Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0

    * Try: Run with --stacktrace option to get the stack trace. Run with --info or --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 7s 14 actionable tasks: 1 executed, 13 up-to-date Building the android package failed! -- For more information, run this command with --verbose. 13:40:16: The process "C:\Qt\5.12.0\android_armv7\bin\androiddeployqt.exe" exited with code 14. Error while building/deploying project Test_1 (kit: Android for armeabi-v7a (Clang Qt 5.12.0 for Android ARMv7)) When executing step "Build Android APK"

    I even went for android-ndk-r17c-windows-x86_64.zip and replaced it with NDK r18b, but no changes in the result!

    What is the problem please? Isn't that related to the path I created the project?
    I think you, too, create Android apps using the Arm7 kit and building the application is part of its creation. So there must be some way to solve the problem. Agree?



  • Any updates on how you fixed it?
    I am getting the exactly same error



  • @sh-zam

    I am using
    0_1552166056436_4af69ed0-1f19-43e8-9535-9e0c4b47eeca-image.png
    with Qt5.12.1 on Windows 10 64 bit.
    This NDK version is more recent and I used it already with Qt5.12.0.

    Hope that helps.



  • @sh-zam
    I think at the time I disabled both Windows Firewall and Anti-virus temporarily, and it worked.
    Do this and if it starts downloading, then it's going to be solved.



  • To fix it I changed my API level to 26, and then had to remove some duplicate files create by qt.

    Thank you for responding!


Log in to reply