Skip to content

Qt Compile Notes for Creator 4.11, Qt 5.14.1

Patrick Clemins edited this page Mar 13, 2020 · 7 revisions

Getting Started

Qt Android Development Requirements
Qt for Android - Building from Source -- But probably want to download the installer instead

Required Libraries

Gumbo Parser

https://github.com/lagner/QGumboParser
https://github.com/google/gumbo-parser

Qt SVG Add on (Moved out of core modules in 5.14)

Instructions

Summary:

  1. Compile Qt SVG Add on
  • Cloned from: https://github.com/qt/qtsvg/releases
    • Get release for version of Qt being used.
    • Used .pro file in git repo to open in Qt and then built release version for Windows MinGW kit
  1. Install to Qt Environment
  • Copied compiled folders (lib, bin, etc.) to QtCreater directory - C:\Qt\Tools\QtCreator
  1. Add svg to .pro file at QT += core gui network xml svg

SSL (for Android, required with API move to https)

General Instructions
Script for Android Compilation

  • Used OpenSSL 1.1.1d
  • Needed NDK r21 for Linux to compile SSL for Android (OpenSSL make was configured for Linux)
  • Older NDK: https://developer.android.com/ndk/downloads/older_releases
  • Finally found success with the compile on Windows 10 using Windows Subsystem for Linux, Ubuntu. Probably would have been quicker just using Linux.

Android Compile Issues

  • Android Gradle plugin (3.4.1) and Gradle version (5.1.1) were out of sync.
  • Also, needed to add google() repo
  • A refresh of the Qt default Android build files fixed both of these issues
  • Project... Build... Build Android APK... Create Templates

Misc Tips

An APK is a .zip file...

Tip: Always run gradlew lint (or gradlew.bat lint on Windows) command in the build directory after any Android-related changes and look into HTML report file produced by this tool. It warns about many potential issues and inconsistencies (manifest issues, API version mismatches, invalid and unused resources, localization issues, general programming errors in your Android-related Java code, obsolete dependencies, and so on, and so on). Very useful.

https://doc.qt.io/qtcreator/creator-developing-ios.html#specifying-supported-ios-versions