Solved 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.12I 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.
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.
-
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.
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).