Qt Creator Android Mac OSX 无法编译

Qt Creator Android Mac OSX Can't compile

我正在尝试使用 Qt Creator Community Edition 为 Android 编译 QML 应用程序。它实际上是新项目向导创建的样板应用程序。我花了好几个小时寻找解决方案,但我不知道出了什么问题。这是我第一次在 Mac 上使用 Android,我的 Linux 机器上没有任何问题。我需要一些关于如何让它工作的指导。这是信息:

这是使用 ant 编译输出中的错误:

Running Android tool to create package definition.
  -- Command: /Users/derek/Library/Android/sdk/tools/android update project --path /Users/derek/0QT/0QtQuick/tester/build-tester-Android_for_x86_GCC_4_9_Qt_5_7_1-Debug/android-build/ --target android-25 --name QtApp
Building Android package using ant.
Using ant: /Users/derek/apache-ant-1.10.1/bin/ant
Buildfile: build.xml does not exist!
Build failed
Building the android package failed!
10:14:14: The process "/Users/derek/Qt/5.7/android_x86/bin/androiddeployqt" exited with code 14.
Error while building/deploying project tester (kit: Android for x86 (GCC 4.9, Qt 5.7.1))
When executing step "Build Android APK"

这里是使用gradle编译输出的错误:

Copying Android package template.
Cannot find template directory /Users/derek/Library/Android/sdk/tools/templates/gradle/wrapper
10:18:21: The process "/Users/derek/Qt/5.7/android_x86/bin/androiddeployqt" exited with code 3.
Error while building/deploying project tester (kit: Android for x86 (GCC 4.9, Qt 5.7.1))
When executing step "Build Android APK"

我的 Linux 机器从来没有遇到过这些问题,所以我真的不知道如何解决这个问题。我在 ant 和 gradle 之间没有偏好,所以我会使用任何可以工作的东西。我可以为 iOS 编译没问题,所以我猜它与我的 Android 设置有关。

这些是我在 Qt Creator 中的设置:

就Gradle而言,这个问题是一个错误。目前,可以在这里找到解决方案:

https://bugreports.qt.io/browse/QTBUG-59236

这是为工具目录提供下载 link 的具体注释:

https://bugreports.qt.io/browse/QTBUG-59236?focusedCommentId=349085&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-349085

我发现使用整个目录有问题,所以我建议只将模板目录复制到现有的工具目录中。