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

Building for Android



  • For some time now I've been unsuccessfully trying to build for Android. One of the Android Studio or SDK updates must have caused it as I haven't changed anything.

    Qt 5.11.3
    Qt Creator 4.12

    aa47dad6-d981-4ae7-9d3a-1b1d8987b83d-image.png

    I can't run qmake.

    This is the error I'm getting:
    <path>/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++' is not recognized as an internal or external command, operable program or batch file.

    This makes sense because the file doesn't exist. The Android kit uses clang.

    0dc21e16-86e1-4f82-81f9-e77a092c54c5-image.png

    Where would I tell Qt Creator to work with the kit's compiler?
    Or, how and from where would I get an arm-linux-androideabi-g++.exe file that would successfully build?

    Any help or just considerations are appreciated.


  • Lifetime Qt Champion

    Hi,

    From the top of my head, your NDK is too recent for the version of Qt you are using. Either use a version more recent of Qt or downgrade the NDK to r107.



  • Thanks a lot. I renamed the folder ndk-bundle and copied NDK r10e in, then renamed that to ndk-bundle.

    I don't know how and why this has changed/updated to a different NDK version. This had always been r10e before. That's what https://doc.qt.io/qt-5/android-getting-started.html suggests, and that's what I think I used for the setup.

    Now I got the next issue when the build process tries to package (AndroidManifest.xml:27:1-108: AAPT: error: resource array/bundled_in_lib (aka ...:array/bundled_in_lib) not found.

    Since this is a different issue I'd say the original issue can be closed as solved. Thanks again!



  • Yes, I just went to Tools -> Options -> Devices, then Android tab. Qt Creator claims that necessary packages are missing. I most likely followed this advice in the past and broke my installation with it.

    56e89bd7-3b64-45c0-b673-f1175e2605cf-image.png

    This looks like a bug in Qt Creator, although it's actually only wrong for Qt versions below 5.12.6 (according to https://doc.qt.io/qt-5/android-getting-started.html).


Log in to reply