Qt for Android
-
Hi,
I tried to follow these instructions on linux (Ubuntu):
and failed. Qt compiled no problem, but Qt Creator can not configure kits and there is only one red cross at the Device configuration with the option "SDK installed", everything else is green. Can not figure out how to configure the kits, it says "Qt versions are missing for the following architectures" and then like mips-linux-android, arm, x86 etc.
Then I switched to Windows and installed latest versions of everything: Qt 5.12.1, SDK 26.1.1, NDK 19.1.5304403 and Oracle Java 11. I did try NDK version 10 as advised somewhere but it did not change anything. I have the same red cross as on linux but go one step further - the kits are automatically defined with Clang (arm64-v8a, armeabi-v7a, x86) but compilation fails like:
Android build SDK not defined. Check Android settings.
Error while building/deploying project analogclock (kit: Android for x86 (Clang Qt 5.12.1 for Android x86))
When executing step "Build Android APK"Please advise how to set up the environment correctly. It's a hell of frustration and quite a show stopper for me.
Thanks for any hints or reports of specific combination of working versions.
-
Did you check this link ? https://doc.qt.io/qt-5/android-getting-started.html
We have tried many times & it works superb.
-
Many thanks for your reply. Yes I did follow this link as well :) However, it has issues like e.g. "android" command being obsolete or "sdkmanager" plain not working.
At the end of my struggle I found that the only missing component of the puzzle on Windows was using (old) Java 8 instead of the latest 11.
However this only worked on Windows. Still can not come to terms on Linux. Followed all instructions to no avail. Compiled Qt no problem, Qt Designer complains with the mentioned red cross and does not automatically create kits. Have anyone here succeeded on Linux?
Regards
Dominik -
@Domel07 said in Qt for Android:
Have anyone here succeeded on Linux?
Use OpenJDK 8, Qt 5.12.1, newest SDK and NDK. For me it works.
-
@Domel07 I only ever had problems when I has android studio also installed on my system, or when I had more than 1 valid java installation.
Since I switched to command line tools only and stick with one jdk(working mind you) I haven't had any problems with Qt for Android
-
Thank you guys for all the replies. Can you please post your configuration command? Here is mine:
./configure -xplatform android-clang --disable-rpath -nomake tests -nomake examples -android-ndk /home/dominik/Android/Sdk/ndk-bundle/ -android-sdk /home/dominik/Android/Sdk -android-ndk-host linux-x86_64 -android-toolchain-version 4.9 -skip qttranslations -skip qtserialport -no-warnings-are-errors
Using At 5.12.1 and the latest sdk/ndk, open jdk 8.
Thanks!
-
@Domel07 said in Qt for Android:
./configure -xplatform android-clang --disable-rpath -nomake tests -nomake
Just confused or curious, I don't know. Are you building Qt yourself?
Is there something preventing you to develop on let's say a Linux host and connect your Android device and deploy to and run your Qt application on it?
-
@Pablo-J.-Rogina yes, building Qt from sources. Because I could not find a Ubuntu prebuilt version. Is there a prebuilt version of the latest Qt for Ubuntu? I could not locate one, but I might have missed it.
However I have successfully set up the latest Qt prebuilt for Windows. Works almost out of the box, the only glitch is java version (11 won't work, need to roll back to 8).
-
@Domel07 jep
http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run
http://download.qt.io/official_releases/online_installers/qt-unified-linux-x86-online.runno idea if the links work, iām on an iPad š
-
@Domel07 what about http://download.qt.io/archive/qt/ ?
-
@Pablo-J.-Rogina Many thanks, that's it!