QT Creator不会列出任何可用的Android Build SDK [英] QT Creator wont list any available Android Build SDKs

查看:149
本文介绍了QT Creator不会列出任何可用的Android Build SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试使用QT Creator构建和运行示例项目时,它失败,并说:

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!

我找到的所有解决方案都是在Build Android APK中选择合适的Android build SDK,但是该选项的下拉框为灰色:

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:

空的Android构建SDK下拉列表

研究此问题时,我能找到的唯一解决方案是人们说要确保将我的JDK,SDK和NDK路径放入Tools > Options > Devices > Android区域中,而这已经完成了:

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路径

还没有真正找到导致问题的其他原因.任何关于从这里出发的想法都将不胜感激.

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.

推荐答案

最新的Android SDK工具(25.3.0)存在问题

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

QT 5.8/QT Creator 4.2.1使用Android工具中已删除的旧可执行文件.

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不能自动与Android SDK Tools 25.3.0配合使用,要使其正常运行,您需要手动修改文件:

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无法区分Android目标版本,需要在<project>.pro.user文件中对其进行修改(编辑此文件时必须关闭QT)

  • 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)

此外,由于未记录的更改,Android SDK Tools不再提供templates文件夹. QT要求它们在那里进行构建,因此您需要将它们从AndroidStudio复制:<path to AndroidStudio>\plugins\android\lib\templates<path to Android SDK>\templates

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

信息:通过AndroidStudio对SDK软件包进行的每次更新都会删除此文件夹,您需要再次复制它

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

最简单的解决方案是获取旧版本的Android SDK工具(并将其仅用于QT).通过修改此网站 https://developer.android的链接,我设法做到了. com/studio/index.html#downloads 指向以前的版本:

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

这篇关于QT Creator不会列出任何可用的Android Build SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆