Setting up Qt for Android

Setting up Qt for Android was not straightforward each time I tried, so here are the requirements.

This installation was on Windows, but should be similar on OS X and Linux. Don’t start installing Qt, because the Qt installer can only preconfigure your Kit if the requirements are already installed.

  • Install OpenJDK8. Java version 1.8 is required, other versions won’t work at the time of writing.
  • Install Android Studio. You could install the SDK command line tools instead, but this way is more convenient.
  • Run Android Studio, create a project to open the SDK manager.
  • Select Tools - SDK Manager: check boxes to install NDK, SDK tools (deprecated)
  • Install Qt.

Now the installer should auto-detect your settings, otherwise you can specify all paths manually. Open one of the Android examples and deploy to the emulator.

On Windows, there will be filesystem errors during compilation if the build path is too long, just choose a shorter name for the build directory.

Avatar
Mitja Kleider
Software Developer