- Qt 6.11
- Product information
- Supported Platforms
- Qt for Android
- Publishing to Google Play
- Qt 6.11.0 Reference Documentation

Deploying an Application on Android ◦ Using third-party libraries

# Publishing to Google Play

Qt for Android provides everything you need to develop, build, and package Android apps. This guide shows you how to configure, build, and publish your app to Google Play Console.

## Configuring your app

Configure your Android app settings using CMake APIs or by editing the manifest directly. Android apps require various settings in `AndroidManifest.xml` and Gradle build files. Qt 6 provides convenient CMake APIs to manage these from your project.

### Set essential app properties

Define your app's package name, version, and Android SDK requirements:

     set_target_properties(${appname} PROPERTIES
         QT_ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android"
         QT_ANDROID_PACKAGE_NAME "io.qt.calqlatr"
         QT_ANDROID_APP_NAME "Calqlatr"
         QT_ANDROID_TARGET_SDK_VERSION 35
         QT_ANDROID_MIN_SDK_VERSION 28
         QT_ANDROID_VERSION_NAME "1.0"
         QT_ANDROID_VERSION_CODE 10
     )

Note: Check the current Google Play target SDK version requirement and set `QT_ANDROID_TARGET_SDK_VERSION` accordingly. You can target higher versions than the minimum requirement.

### Configure app icons

Set your app icon and create the icon files in the correct directories:

     set_target_properties(${appname} PROPERTIES
         QT_ANDROID_APP_ICON "@drawable/ic_launcher"
     )

Place your icon files in:

     <QT_ANDROID_PACKAGE_SOURCE_DIR>/res/drawable-<dpi>

You can create icon files using:

- Qt Creator Android Icon Generator
- Android Studio: Image Asset Studio
- Online Android icon generators

### Optimize plugin packaging

Reduce your app size by specifying which plugins to include. The androiddeployqt tool may include plugins your app doesn't need at runtime:

     qt_import_plugins(${appname}
         INCLUDE_BY_TYPE imageformats Qt::QSvgPlugin Qt::QJpegPlugin
         EXCLUDE_BY_TYPE iconengines networkinformation tls platforminputcontexts qmltooling
     )

Note: The qt_import_plugins() function only includes plugins from your target's linked dependencies.

#### Related documentation

- Qt for Android Manifest File Configuration
- The androiddeployqt Tool

## Building your app

Build your app for release and prepare it for Google Play Console submission.

### Configure release build

Google Play requires release builds. Debug information can be included as separate files and is encouraged for better crash reporting:

#### via Qt Creator

1. Open your project in Qt Creator
2. Select Projects from the sidebar
3. Choose Release build configuration

#### via CMake

     qt-cmake -DCMAKE_BUILD_TYPE=Release

Ensure debuggable is set to `false` in your manifest or Gradle configuration.

### Enable multi-ABI support

Build your app for multiple device architectures to maximize compatibility:

#### via Qt Creator

1. Go to Projects > Build
2. In the CMake configuration settings, set `QT_ANDROID_BUILD_ALL_ABIS` to `ON`

#### via CMake

     qt-cmake -DQT_ANDROID_BUILD_ALL_ABIS:BOOL=ON ...

### Create signing keys

Google Play Console requires signed app releases. Google recommends using Google Play managed signing with two keys:

- Signing key: Generated and managed by Google when you create your app in Google Play Console
- Upload key: Managed locally to sign app bundles for upload

#### via Qt Creator

1. Open Projects > Build
2. Select Build Android APK
3. Click Create under Application Signature
4. Fill in the keystore details
5. Enable Sign package

See Signing Android Packages for detailed instructions.

#### via Command Line

Generate a keystore:

     keytool -genkey -keyalg RSA -keystore upload-key.keystore \
         -alias play_apps \
         -storepass <password> -keypass <key-password> \
         -dname "CN=<n>, OU=<unit>, O=<organisation>, L=<city>, ST=<state>, C=<country>"

Enable signing:

     qt-cmake -DQT_ANDROID_SIGN_APK:BOOL=ON -DQT_ANDROID_SIGN_AAB:BOOL=ON ...

Set the environment variables:

     export QT_ANDROID_KEYSTORE_PATH=upload-key.keystore
     export QT_ANDROID_KEYSTORE_ALIAS=play_apps
     export QT_ANDROID_KEYSTORE_STORE_PASS=<password>
     export QT_ANDROID_KEYSTORE_KEY_PASS=<key-password>

### Generate app bundles (AAB)

Google Play Console now primarily accepts Android App Bundles (AAB) instead of APKs. AAB packages allow Google Play to optimize app delivery for each device.

#### via Qt Creator

1. Go to Projects > Build
2. Select Build Android APK
3. Under Advanced Actions, enable Build Android App Bundle
4. Optionally enable Open package location after build
5. Build your project

#### via CMake

Generate an AAB:

     cd build
     cmake --build . --target aab

For a specific target:

     cmake --build . --target appname_make_aab

Your AAB file is saved to: `/<build-path>/android-build-appname/build/outputs/bundle/release/`

#### Related documentation

- Google's Play App Signing guide
- Android App Bundle FAQ

## Publishing to Google Play Console

After building and signing your app, publish it to Google Play Console for distribution.

### Prepare for upload

Before uploading:

1. Test your app thoroughly on different devices and Android versions
2. Prepare promotional materials (screenshots, descriptions, feature graphics)
3. Review Google Play's content policies and guidelines

### Create your app in Google Play Console

1. Sign in to Google Play Console
2. Create a new app or select an existing one
3. Complete the app details and content rating questionnaire
4. Set up pricing and distribution settings

To create an account if you don't have one, see Google's Play Console setup guide.

### Upload your app bundle

1. Navigate to Release > Production
2. Create a new release
3. Upload your signed AAB file
4. Add release notes
5. Review and roll out the release

#### Resources

- Create and set up your app
- Google's app publishing guide
- Google Play Console webinars

## Special considerations

### Single-ABI builds for legacy projects

For Qt versions that don't support multi-ABI builds (such as qmake projects), build each architecture separately with different version codes:

     ANDROID_VERSION_CODE = <unique_version>

Consider using a versioning scheme like `<Platform><ABI><AppVersion>`:

- Platform: 1 for Arm, 2 for Intel
- Architecture: 32 for 32-bit, 64 for 64-bit

Example: Release 1.0 for arm64-v8a uses version code `16410`.

See Google's app versioning documentation for details.

See also Deploying an Application on Android.

Deploying an Application on Android ◦ Using third-party libraries