2

I'm trying to compile a QML App for Android using Qt Creator Community Edition. It's literally the boilerplate app that the new project wizard creates. I have been searching for hours looking for a solution and I can't figure out what's wrong. This is my first time working with Android on Mac, I have no issues on my Linux machine. I need some guidance on how to get this working. Here's the info:

  • MacOS Sierra 10.12.4
  • Qt Creator 4.2.2 Based on Qt 5.8.0 (Clang 7.0 (Apple), 64 bit)
  • Android Studio 2.3.1
  • Android SDK Platforms: 7.0 & 7.1.1
  • Android SDK Build-Tools: 19.1.0, 25.0.2, 25.0.3
  • Android NDK version 14.1.3816874

Here's the error in the compile output using 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"

Here's the error in the compile output using 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"

I never had these issues with my Linux machine, so I really have no idea how to even troubleshoot this. I don't have a preference between ant and gradle, so whatever one I can get working is what I'll work with. I can compile for iOS no problem, so I'm guessing it has something to do with my Android setup.

These are my settings in Qt Creator: enter image description here

Derek Nowicki
  • 283
  • 5
  • 16
  • Possible duplicate of [Freshly setup Qt build for Android fails on OSX machine](http://stackoverflow.com/questions/43398966/freshly-setup-qt-build-for-android-fails-on-osx-machine) – V-master May 10 '17 at 10:17

1 Answers1

2

As far as Gradle is concerned, this issue is a bug. For now, the solution can be found here:

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

This is the specific comment that gives the download link for the tools directory:

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

I found that there were issues with using the entire directory, so I recommend just copying the templates directory into the existing tools directory.

Derek Nowicki
  • 283
  • 5
  • 16