Skip to main content Logo

Quis custodiet ipsos custodes?
Home | About | All pages | Cluster Status | RSS Feed | Gopher

A docker image for Qt 5.15 LTS for Android, including OpenSSL and the KDE patch collection

Published: 13-9-2023 22:00 | Author: Remy van Elst | Text only version of this article

Recently I got an email from Google regarding the API level of Leaf Node Monitoring, my open source monitoring app for Windows, Linux and Android. The Play Store version must be updated to target API level 33. For Windows and Linux I'm building the app automatically in a CI environment but the Android build was still a manual process. Until now, because after a bunch of messing around with Android NDK versions, OpenSSL library paths and Qt compile flags I can automatically build Leaf Node Monitoring in my CI.

I'm using Woodpecker CI and that requires every build step to be executed in a Docker image. There are a few Qt docker images floating around but they are all using the pre-built 5.15.2 version by extracting it from the Qt Online Installer. That version is quite old, 5.15.15 LTS was released a few days ago for Commercial License Holders on August 31, so after 1 year it will become available as open source. My docker image builds Qt from source using the 5.15 KDE Qt Patch Collection branch for Android and it includes OpenSSL. This is as far as I know the most up to date docker image for Qt 5.15, currently at 5.15.10 LTS.

Recently I removed all Google Ads from this site due to their invasive tracking, as well as Google Analytics. Please, if you found this content useful, consider a small donation using any of the options below:

I'm developing an open source monitoring app called Leaf Node Monitoring, for windows, linux & android. Go check it out!

Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.

You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $100 credit for 60 days.

Why still use Qt 5.15 you might ask? The short answer is Windows 7 compatibility, Qt 6 dropped that and I find it wasteful to not support computers that still work perfectly fine. I have a strict policy that all code also compiles and is tested on Qt 6, but my main distribution channel is Qt 5.15.

If you'd like an image for regular Linux, send me an email. If there is enough interest I could make one.

A bit of history regarding the Qt 5.15 policy change

Remember, 2 years ago in 2021, the Qt Company made a lot of people very angry by closing down the source code of Qt 5.15. But due to an agreement with the KDE Free Qt Foundation they must release the source code within 12 months otherwise KDE can release Qt under a BSD style license.

That would be bad for the Qt Company because no one then has to pay for a license anymore and they don't have to release source code. Now you must pay for a license or release your source code under the GPLv3 (or fiddle with the LGPL).

So exactly 1 year (-1 day) after every 5.15 release, the Qt Company drops the source code for the 5.15 LTS version, here is my article on the first release after the policy change, 5.15.3.

The KDE folks maintain a branch with backported patches and the most recent 5.15 LTS code. I'm using that branch for my Android app and for the Linux version. Windows still uses 5.15.2 from the installer due to an issue with ANGLE, QML will not work with a cross-compiled version (yet)

My docker image

The docker image includes most of the Android tools as local zip files that are COPY'd into the image. I want to preserve those as Google might remove them from the sdkmanager tool any time. I mirror Qt source code at home so that will stay available for me at least, which is why it's not in the docker image assets.

You can find the docker image here:

You can pull it locally using the following command:

docker pull raymii/qt:5.15-android-source

The source code and assets are up on Github:

If you use the image in your build system, make sure to sync up the NDK_VERSION and BUILD_TOOLS in the Dockerfile with the ndkVersion and buildToolsVersion in your build.gradle file:




buildToolsVersion '30.0.2'
ndkVersion '22.1.7171670'

My Woodpecker CI file contains the following code to build the debug build for Leaf Node Monitoring, as an example reference on how to use the Docker image:

  image: raymii/qt:5.15-android-source
    - /ccache:/ccache
    - CCACHE_DIR=/ccache/
    - ANDROID_ABIS="arm64-v8a" 
    - export PATH=$PATH:/usr/local/Qt-5.15.10/bin:$CI_WORKSPACE/build/bin/
    - sudo chmod -R a+w .
    - mkdir build-debug
    - cd build-debug
    - qmake .. CONFIG+=debug CONFIG+=qtquickcompiler CONFIG+=ccache -spec android-clang ANDROID_ABIS="$ANDROID_ABIS"
    - make -j
    - make -j apk_install_target
    - sudo chown -R $(whoami) $ANDROID_HOME
    - androiddeployqt --input android-$PROJECTNAME-deployment-settings.json --gradle --output ./android-build/ 

The KDE sysadmin CI images dockerfile was the most helpful in finding the right NDK version for 5.15.10. The Qt documentation lists a different version (21.0.6113669) which, for me, did not work with API level 33. All kinds of errors regarding unknown Java methods or other strange errors (AAPT: error: attribute android:allowNativeHeapPointerTagging not found.). This (translated) article was also helpful.

The asset files you need

Github blocks files larger than 100 MB, so you'll need to download the assets yourself, including their md5sum here:

b99a69907ca29e8181852645328b6004  ./
a858219c60cf559a1e206fd9be7f5c70  ./
ff016ef6fe902a22839895dbb4b8afb6  ./
ca155336e152acb9f40697ef93772503  ./
e687a5b5cc7bb3af39d0e9528ac4a84c  ./
d811f1344b16c7113733cc7b801efdab  ./

They are in the docker image that is on Docker hub however, but if you want to build the image yourself you need these files.

Tags: android , blog , c++ , cmake , cpp , docker , kde , moc , qmake , qml , qt , qt5