46

I am developing Qt Cross platform application for Android, recently i have updated Qt creator and Installed new Qt version. I am using 'Qt Creator version 4.5.0'. I have updated to 'QT version 5.10'. This Set up is done on Ubuntu 16.04.

Followed link Getting Started with QT Installation.

I am always getting Error message "Android Settings have error" in Qt Creator->Tools->Options->Devices->Android.

QT Android Installation Issue

Because of above issue i am not able to build application for Android.

I have recently updated my Android sdk, I am able to build and run Sample application from Android Studio, indicating that SDK instalation is working properly. I am using Android SDK tools 26.1.1. Please check bellow screen shots.

Android Studio SDK manager

Android SDK build tools Installed. enter image description here

Android SDk platforms installed enter image description here

Already gone through different links on Stack Overflow and QT forum, All are Suggesting downgrade of Android SDK tools(Due to QT Known bug), but none of the solution is working for me. I know there are few known bugs building Android application with QT 5.9 and Qt Creator version 4.0. I guess It is resolved, as same set up is working fine on Windows 10.

QT Creator wont list any available Android Build SDKs QT Android Installation error

Please help if anybody here resolved same issue.

cbuchart
  • 10,847
  • 9
  • 53
  • 93
Swapnil
  • 2,409
  • 4
  • 26
  • 48
  • 1
    In your Android SDK manager under "SDK Platforms" do you have API level 25 installed? it seems not, try install it first. and as you show the "Android SDK platform tools" is 27 not 26. – Mohammad Kanan Jan 11 '18 at 22:49
  • @MohammadKanan thanks for help, yes 'API Level 25' is already installed, please check updated screen shots for more information. Still i am getting above issue. – Swapnil Jan 16 '18 at 09:02

12 Answers12

32

I just found this bugreport, where in the comments can be found

The native 'sdkmanager' tool can not update packages on windows and it fails with JDK 9 and these issues cascades to Qt Creator also.

I just tried installing JDK 8 and changing the path, and after reopening the settings menu it had worked!

Vesafary
  • 321
  • 1
  • 2
  • 3
11

After lot of effort I am able to fix this issue, thanks to Mohammad Kanan, Vesafary who's answer made me get closer to Answer, Actual issue resolved with the following steps. It may be helpful who are facing the same issue In Ubuntu or may work on other platforms as well.

  1. First Step is (as most of the answers suggest) changed from JDK 9 to JDK 8. I am using Java version "1.8.0_152".
  2. Step 1 didn't help me (Qt creator Persist some Settings), so i removed complete Qt 5.8,5.9,5.10 installation (Using Qt Maintainace tool) and following 2 links Uninstall Qt Completely, Uninstall Qt Creator.

and did Instalation again. May be your problem get resolved at this step.

  1. Step 2 also didn't help in my case, QT Creator still persist few settings and need to reset Qt creator settings. That can be done by deleting data in this folder

    ~/.config/QtProject ~/.config/Qt file ~/.config/QtProject.conf

path may be different in different System and OS. following links will be helpful in this case.

Creator FAQ

Stack Overflow Qt Settings 1

Stack Overflow Qt Settings 2

Now i am able to build and run android application.

Swapnil
  • 2,409
  • 4
  • 26
  • 48
  • In our SDK Folder is a binary: Sdk/tools/bin/sdkmanager. This does not seem to work with java 9 or greater and qtcreator uses this to detect the platform sdk. Due to sloppy writing it does not discriminate between there is no sdk installed and the sdkmanager is broken. – Dennis Beier Apr 25 '18 at 16:54
  • So, there is probably no solution for somebody who has to work with given versions of QtCreator and the JDK? Have the same problem, but without the option of switching those out. – Aziuth Oct 16 '18 at 09:27
10

I am using the answer box to show you how it works for me, one last comment: I don't install NDK 16 .. try remove it from Android manager; while (For Qt) install seperately NDK 10e (this was a Qt recommendation already). enter image description here

And Qt configuration side: enter image description here

enter image description here

Mohammad Kanan
  • 4,452
  • 10
  • 23
  • 47
9

"Platform SDK installed" requires a working a sdkmanager command.

If you have the Platform SDK installed, try running the sdkmanager command directly.

This is $ANDROID_SDK_ROOT/tools/bin/sdkmanager. On my Linux system this was in $HOME/Android/Sdk/tools/bin/sdkmanager.

The typically issue is

  • You need to install JDK 8 properly (note that JDK 9, JDK 10 and JDK 11 will not work!)

If you have installed a newer JDK you will need to downgrade to JDK 8. Either OpenJDK or Oracle will work, but it needs to be JDK 8.

Work thru any remaining issues with the sdkmanager command line, then, once that's done, you should find Qt Creator to be happy again.

References:

Stephen Quan
  • 21,481
  • 4
  • 88
  • 75
2

Thanks I had the same problem, using Debian Buster (sid) with QtCreator 4.6.2 with Qt5.10.1

Go into ~/.config and wipe all the qtcreator settings, then start again specifying jdk.8 then the paths to the Android SDK and then the NDK.

It then works and the dumb SDK platform not installed error does not occur. :)

Out of interest I tried wiping everything ~/.config/qtcreator* and then specifying jdk10. Does not work as before.

If you then change to jdk8, it still does not work. You have to close QtCreator, wipe all the configs, reopen and choose it again, whereon it will work.

MickG
  • 21
  • 2
  • on ubuntu 18 in Feb 2019 i had to use JDK /usr/lib/jvm/java-1.8.0-openjdk-amd64 with SDK /home/don/Android/Sdk/ and NDK /home/don/Android/Sdk/ndk-bundle and in sdkmanager also add versions 25 and 27. bizarre, flaky issue – don bright Feb 10 '19 at 05:03
2

I just had the exact same symptoms as the OP. Just that unlike the OP, I was using Qt Creator 4.8.0, as provided in the Ubuntu 19.10 repositories.

Symptoms

The relevant part from the Qt Creator self-check list is:

✓  SDK tools installed.
X  Platform SDK installed.

An additional symptom was that the "SDK Manager" tab below had this message:

SDK manager is not available with the current version of SDK tools. Use Native SDK Manager.

Cause and Fix

The reason for this issue was a wrong version of SDK tools. That wrong version is recognized ("SDK tools installed.") but cannot be utilized by Qt Creator to detect which platform SDK is installed or to install new ones.

In my case, I had simply downloaded the latest version, provided as commandlinetools-linux-*_latest.zip on the Android Studio download page. That version introduced changes that are not backwards compatible with the interface of earlier versions that Qt Creator is expecting. That new package is indeed quite different: it has a different name (commandlinetools vs. sdk-tools), expects to be in a different place etc..

To solve this, download and install "Android SDK Tools 26.1.1" (rev. 4333796) as follows, supplying your own Android SDK directory of course:

cd /opt/android-sdk/
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip

That fixed all the symptoms described above.

tanius
  • 14,003
  • 3
  • 51
  • 63
1

you do not need to wipe the configs for qt. simply install the latest of jdk 8 from here -> http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

next select the jdk location in the options and then toward the bottom select the sdk manager tab. Click the update installed button and it should show a window with a list of licenses you need to agree to.

The problem lies with jdk 9 and up. For some odd reason it doesn't show the license agreements and doesn't continue beyond that point. The fix is sticking with jdk8

1

OK, after many many hours try-out I finally find out how we can fix it.

  • Download and use Android NDK r10e separately (don't install it through SDK Manager)
  • Download and use Android SDK without Android Studio (download android tools from official site) Qt Preferences will installs all needed packages (build tools , platform tools, sdk tools, platform android-28)
  • Install and use Java JDK 8 (not newer)

Please note that installing SDK packages through Android Studio will not be detectable by Qt

S.M.Mousavi
  • 5,013
  • 7
  • 44
  • 59
1

Linux:

The proposed solutions did not work for me.

I already had Java 8 and with Qt 5.12 installed the latest SDK and NDK are supposed to work (should work since Qt 5.9).

After hours of fiddling, reinstalling Qt and Java, removing configs, downloading older NDKs and all, it still did not work.

My mistake was that I unpacked SDK and NDK as root into a read-only location for the user. After chowning the folder to the my normal user, Creator found everything and worked as expected.

So also check, if the user running Qt Creator owns the folder containing SDK and NDK. It's a quick check that might prevent you from deleting your configs. :)

Edit: In August 2019, I added a patch to Qt Creator, checking for this partiicular case and reporting an error accordingly. https://code.qt.io/cgit/qt-creator/qt-creator.git/commit/?id=4ca3bd4d0f336f7055080e78849c0607ba99843c

1

In my case I had red crosses for SDK tools installed. and for Platform SDK installed.

To resolve it I needed to download android sdk tools from https://androidsdkoffline.blogspot.com/p/android-sdk-tools.html

file was tools_r25.2.5-linux.zip

I placed extracted tools folder in sdk folder. My setup now works only with open-jdk-8 Now I can deploy qml apps on my S10

0

To add on to the accepted answer of needing JDK 8 - if you already have a newer version of Java running, you can easily install a standalone version 8 alongside it. Use the installer from https://adoptopenjdk.net/ and select v8.0. Make sure to update your preferences to point to the Java 8 and things should work.

67hz
  • 381
  • 3
  • 7
0

In my case, I download the separate SDK download tool, android-sdk_r24.4.1-windows, and Installed the SDK again. the Android SDK Platform-tools is a part of Android SDK Manager.and I resolved the problem.