Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Today's working combination of tool versions for C++ Android programming with Qt?

Tags:

android

qt

What is a working combination of versions of the development tools if I want to develop C++ Qt Android apps? I tried several combinations but they all fail with strange build errors of a simple Hello World test app.

Currently, I have

  • Qt Creator 4.2.1 (based on Qt 5.8.0, MSVC 2015, 32bit)
  • JDK 10.0.1
  • Android SDK 24.4.1-win
  • Android NDK r10e
  • Apache ant 1.9.11

but e.g. that fails with

Buildfile: build.xml does not exist!
Build failed
Warning: Android platform 'android--1' does not exist in SDK.
Building the android package failed!
  -- For more information, run this command with --verbose.
21:35:44: Der Prozess "C:\EigeneDateien\bin\Qt-5.8.0\5.8\android_armv7\bin\androiddeployqt.exe" wurde mit dem Rückgabewert 14 beendet.

I want to use an open source version.

Please, give a list of tools with correct version numbers and maybe download links.

like image 953
falkb Avatar asked May 10 '18 19:05

falkb


People also ask

Which Android devices are supported by Qt 5?

Devices with Android version 4.1 (API level 16) or later are supported when developing with Qt 5 and devices with Android version 6.0 (API level 23) when developing with Qt 6. To develop for Android, you must have a tool chain for building applications for Android devices installed on the development PC.

What is Qt Creator for Android?

Qt Creator offers to automatically install all the necessary packages and tools and to set up your development environment by creating debuggers, tool chains, and kits. You can use Qt Creator to: Download and extract the Android SDK Command-line Tools. Install or update the essential packages such as NDKs, build tools, and platform tools.

How do I add an Android device to Qt?

Select Tools > Options > Devices > Add > Android Device on Windows and Linux or Qt Creator > Preferences > Devices > Add > Android Device on macOS to open the Create New AVD dialog. Set the name, definition, architecture, target API level, and SD card size of the device.

Is C++ still supported in Qt 5?

The traditional C++-only QWidgets continued to be supported, but did not benefit from the performance improvements available through the new architecture. [136] Qt 5 brings significant improvements to the speed and ease of developing user interfaces. [137]


1 Answers

The good procedure is to use Qt's online installer (https://www.qt.io/download-qt-installer), get the latest version of QtCreator/Qt, then the latest version of ndk/sdk/jdk and cross your fingers because it does not always work...

I fighted a bt with this in early 2019 and here is a combination that perfectly works for me since then, under Windows 7 and 10.

  • QtCreator 4.8.0, based on Qt 5.12.0. I got it from the online installer by then and archived it, but you can apparently specifically download it from here.

  • NDK r18b

  • JDK 1.8.0_201, can be dowaloaded from this page (find jdk-8u201-windows-x64.exe)

  • Android SDK command line tools "sdk-tools-windows-4333796", available here. Then used sdkmanager to download API platform-tools and android-28. Try sdkmanager "platform-tools" "platforms;android-28"

No need for ant anymore, QtCreator will download and use gradle silently.

like image 186
jpo38 Avatar answered Oct 13 '22 05:10

jpo38