skip to Main Content

As indicated in the heading, I am encountering difficulties setting up QT Creator for Android development. Despite having downloaded the SDK and NDK through QT and Android Studio, errors persist in the following areas:

  1. Android SDK Command-line Tools runs
  2. Android Platform SDK (version) installed.
  3. All essential packages installed for all installed Qt versions.

QT Creator devices screenshot

I have attempted to resolve the issue by updating and downgrading QT to various versions, including 6.6.1, 6.5.0, 6.4.3, and 5.12.12.

Below are the folder structures for both the Android (screenshots attached) and NDK (screenshot attached) components.

SDK Folder structure screenshot

cmd-tools screenshot

ndk Folder structure screenshot

I have cleared the cache and reinstalled QT and SDK multiple times, yet the problem persists. I am using JDK version 8

Additionally, I have verified the functionality of the sdkmanager through a successful command execution. However, clicking on the SDK Manager button within QT devices yields no results (screenshot attached).

QT SDK Manager

I am using Ubuntu 22.04.

  1. I have tried multiple versions of QT (6.6.1, 6.5.0, 6.4.3, and 5.12.12)
  2. I have tried clearing ~/.cache and reinstalling QT
  3. I have tried downloading SDK from android studio
  4. I have tried downloading sdkmanager

2

Answers


  1. Qt 6.6 requires at least JDK 11. From official doc: https://doc.qt.io/qt-6/android-getting-started.html

    I faced similar problems several times and what I learnt is you should use exact the versions they mention in documentation.
    I’ve also found similar problem report here: https://forum.qt.io/topic/153599/problem-in-setting-up-android-with-qt-6-6/2
    And they give good advice regarding Qt Creator Debug logs: https://doc.qt.io/qtcreator/creator-logging-viewer.html

    To make these logs work for you you need to open Qt Creator, Edit->Preferences…->Devices->Android and then enable all logging categories and save them as preset. Then restart Qt Creator load saved logging preset and open Android tab again to let Qt Creator re-check your Android setup. On my Windows machine it runs C:Users<User>AppDataLocalAndroidSdkcmdline-toolslatestbinsdkmanager.bat . It seems to me Qt Creator cannot run similar Linux script for you.

    Login or Signup to reply.
  2. It doesn’t work for me with the officially required JDK 11 version, or the official SDK 31 version, I had to go all the way to JDK 17 and SDK 33 versions. It seems to also be hard-coded to want SDK 31, because it always ends up selected when the sdk maintenance tool starts the user selected installations.

    It looks like there might be some regression in android support, or at least some change on the android side that Qt creator hasn’t caught up with yet. Every once in a while something "updates" and breaks things, and they are usually not implemented in advance, but only after a user bothers to report a bug.

    It works with the more recent versions, but even so, Creator will not automatically create the android kits, because it is unable to recognize the android Qt builds ABI version, however a manually created kit actually works to produce a successful build.

    So, for the time being, either do a manual kit, or fall back to a previous Qt version.

    For ubuntu, I got it running with:

    sudo apt-get install openjdk-17-jre openjdk-17-jdk
    

    For windows I got it running with this JDK version. The website Creator currently links to for JDK also has 17 in its archive, but I haven’t tested gotten to testing it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search