Unable to Deploy Android Application
-
Hello everyone,
I'm using Qt 5.7.0, Qt Creator 4.1.0, on Windows 7.
All components for Android development were installed and configured in Tools -> Options -> Android. Aside from the warning "Qt versions for 3 architectures are missing", the kits were automatically created.
An Android phone is connected to my computer and recognized using adb.I'm able to compile one of the examples without any errors, but when trying to run the application, I get the error:
Cannot find the android build step.
Error while building/deploying project calqlatr (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.7.0))
When executing step "Deploy to Android device"Am I missing some components maybe?
Thank you for your assistance.
-
I think you might be missing ANT or Gradle. You can configure it just below the settings for the Android SDK and NDK. You can download ANT here: http://ant.apache.org/bindownload.cgi .
-
Thanks Dino, Ant was already installed and found by Qt Creator. However, I ran 'ant.bat' in a command line window, and it did complain that it can't find 'tools.jar' in the expected location. I fixed the Java path and now Ant runs OK, but Qt still shows up the same error.
-
Nick, if by system you mean the operating system, than it is x64. The platform-tools version is 24.0.3.
-
Please also check that the Android SDK Build-Tools are installed. They are listed in the Android SDK Manger -> Tools.
-
Yes, I have Android SDK Build-Tools 24.0.2 installed.
-
@Shahar-Klinger
You can also download sdk and ndk tools from Android SDK tool kit and Android NDK tool kit -
Thanks Nick, it's already installed.
Maybe can someone give me a list of required components for Qt? I have a feeling I'm missing something there, as there are many options.
-
@Shahar-Klinger Did you check this introduction: http://doc.qt.io/qt-5/androidgs.html
-
@jsulm Yes, that was one of the first docs I read. One line that troubles me is "2. Select the components you need in the Select Components screen and click Next.".
Maybe I didn't install all the required components, or there is some problem with those I selected?
-
@Shahar-Klinger Which components did you install?
-
The Qt components I installed, as listed in the Maintenance Tool, are as follows:
Qt 5.7.0:
- msvc2013 64-bit
- Android x86
- Android ARMv7
- Other Qt components (Charts, Data Visualization etc.)
Tools:
- MinGW 5.3.0
Thanks!
-
So I just had a breakthrough, that resulted in the application showing up on my phone.
After building the project in Qt, I go to the build directory in a command line prompt, and type:mingw32-make install INSTALL_ROOT=.\Deploy androiddeployqt --output .\Deploy --install --input android-libcalqlatr.so-deployment-settings.json
And lo and behold, the application is installed on the device.
Why doesn't Qt Creator do this automatically?