Trouble setting up for Android
-
I've been migrating to a new (to me) computer and have reinstalled Qt 5.12.11, which apparently came with Qt Creator 5.0.0
and I'm having trouble getting it set up for developing for Android. I've spent several hours trying to clear these errors:
I'm running Java 1.8 as seen here:
and I have several NDK's loaded which are supposedly compatible with this version of Qt, as listed here.
Here is my 'Options->Qt Versions' page:
the three marked kits all say 'No compiler can produce code for this Qt version.'
Here is the 'Options->Compilers' page:
I'm at a loss as to how to proceed. Does anyone have any insight?
Best,
Scott
-
@MScottM said in Trouble setting up for Android:
have reinstalled Qt 5.12.11
Are you sure you've installed Qt for Android components?
I'm asking given the errors shown in the screenshot for Auto-detected kits ("'Options->Qt Versions' page:") -
@MScottM Did you follow Qt Documentation to install base Android components? Cf. https://doc.qt.io/qt-5/android-getting-started.html
I think you have to do something like this:
cd <ANDROID_SDK_ROOT>/tools/bin/ REM to install Android SDK Essentials sdkmanager.bat --sdk_root=<ANDROID_SDK_ROOT> --install "cmdline-tools;latest" sdkmanager.bat --sdk_root=<ANDROID_SDK_ROOT> --install "platform-tools" "platforms;android-29" "build-tools;29.0.2" "ndk;21.3.6528147" REM to install Android emulator sdkmanager.bat --sdk_root=<ANDROID_SDK_ROOT> --install "emulator" "patcher;v4" REM to install USB driver on Windows to allow debugging via ADB sdkmanager.bat --sdk_root=<ANDROID_SDK_ROOT> --install "extras;google;usb_driver"
Note: ANDROID_SDK_ROOT is the path of your android SDK. I guess it is
C:\Users\scott\AppData\Local\Android\Sdk\
-
I went back to the 'Getting Started with Android' page and downloaded and installed the 'OpenJDK' package - I was using the Java provided JDK 8.
In Qt, when I pointed the JDK location (Options->Devices->Java Settings) to the new installation folder (was pointing to an Android location), 'C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot', that triggered Qt to 'Install Missing SDK Packages?' (paraphrasing), which I did.
When that finished, I went to 'Options->Kits->Qt Versions' and selected the first 'red' Qt for Android item and clicked the button on the right, 'Link with Qt...' It prompted for a restart of Qt - when it came back up, everything had cleared up with green checks!
I haven't tried uploading to a phone yet, but I think any issues now would be a new problem... Will mark this solved.
Thank you all!