- Qt 6.9
- Qt Core
- CMake Target Properties in Qt6 Core
- QT_ANDROID_PACKAGE_NAME
- Qt 6.9.2 Reference Documentation

# QT_ANDROID_PACKAGE_NAME

The app's package name.

This property was introduced in Qt 6.8.

Note: This property is used only if targeting the Android platform.

Specifies the app's package name. This is usually a unique dot separated name for the app, that will be used to identify the app on devices or in the Play Store. For example, "org.qtproject.gallery".

     set_target_properties(${target} PROPERTIES
         QT_ANDROID_PACKAGE_NAME "org.qtproject.gallery"
     )

The package name set by this property is passed to the `build.gradle` file as a `namespace` property, instead of `AndroidManifest.xml`, since the latter is deprecated since Android Gradle Plugin 7.4.

The package name considers some words or characters as illegal and the build will clean such names if any is encountered. An underscore (`_`) either replaces illegal characters or is appended to illegal words.

- Allowed characters: alphanumeric, an underscore or a dot [a-zA-Z0-9_.].
- Illegal words: abstract, continue, for, new, switch, assert, default, if, package, synchronized, boolean, do, goto, private, this, break, double, implements, protected, throw, byte, else, import, public, throws, case, enum, instanceof, return, transient, catch, extends, int, short, try, char, final, interface, static, void, class, finally, long, strictfp, volatile, const, float, native, super, while.

The default package name for Qt for Android apps is `org.qtproject.example.<target_name>`.

Note: Setting the package name manually in `build.gradle` (via `namespace` property) takes precedence over `AndroidManifest.xml` (via `package` attribute), and the latter also takes precedence over this property.

For more information, see Android's configure the app module.

See also qt_android_generate_deployment_settings().