QT Creator wont list any available Android Build SDKs

10,135

Solution 1

It is a problem with newest Android SDK Tools (25.3.0)

QT 5.8/QT Creator 4.2.1 uses old, now removed, executables from Android Tools.

https://developer.android.com/studio/releases/sdk-tools.html SDK Tools, Revision 25.3.0 (March 2017):

Obsolete/deprecated tools have been removed:

  • android

QT 5.8 will not work automatically with Android SDK Tools 25.3.0, and to make it work, you will need to modify files by hand:

  • QT is unable to distinguish Android target versions and those need to be modified in <project>.pro.user file (QT must be closed while editing this file)

  • Also from not documented changes, there is no longer templates folder available from Android SDK Tools. QT require them to be there to build, so you will need to copy them from AndroidStudio: <path to AndroidStudio>\plugins\android\lib\templates into <path to Android SDK>\templates

    INFO: every update to SDK packages made through AndroidStudio will remove this folder, and you will need to copy it again


easiest solution would be to get older version of Android SDK Tools (and use them only for QT). I've managed to do so by modifying link from this site https://developer.android.com/studio/index.html#downloads to point to previous version:

https://dl.google.com/android/repository/tools_r25.2.5-windows.zip

Solution 2

For linux users, the last version of SDK with UI:

https://dl.google.com/android/repository/tools_r25.2.5-linux.zip

This work automatically with Qt 5.8

Solution 3

As was written by Patrizio Bekerle at QTCREATORBUG-17852:

For reference, this is the download link for the 25.2.5 sdk tools (for Linux) you currently need to build Android apps: https://dl.google.com/android/repository/tools_r25.2.5-linux.zip I found it on https://androidsdkoffline.blogspot.co.at/p/android-sdk-tools.html I was able to build again with this version...

It works for me on MacOS

Share:
10,135

Related videos on Youtube

CamStan
Author by

CamStan

Updated on June 04, 2022

Comments

  • CamStan
    CamStan about 2 years

    When attempting to build and run an example project with QT Creator, it fails, saying:

    Build failed
    Warning: Android platform 'android--1' does not exist in SDK.
    Building the android package failed!
    

    All the solution I have found say to select the appropriate Android build SDK in the Build Android APK, however the dropdown for that option is grayed out:

    Empty Android build SDK dropdown

    When looking into this, the only solution I can find is people saying to make sure my JDK, SDK, and NDK paths were put into the Tools > Options > Devices > Android area, which I'd already done:

    SDK Path

    Haven't really been able to find what else could be causing the problem. Any ideas on where to go from here would be most appreciated.

  • CamStan
    CamStan over 7 years
    Went with the "easiest solution" and used that older version of the tools which immediately got it working. Thank you very much.
  • Andy
    Andy about 7 years
    I had to place my templates folder in <path to Android SDK>/tools/templates
  • Felipe Centeno
    Felipe Centeno about 7 years
    I'm running into the same issue with Qt 5.9 which I thought was suppose to be fixed. I'm just wondering if anyone has actually seen it work? or is this maybe an issue with 5.9 on windows 7?