What you need to know about the plugin:
The plugin allows you to import new or existing Qt QML projects to a new or existing Android Studio project.
You can find what is supported here.
The host environment limitations for building Qt applications also exist for the plugin. The plugin has been tested on the following operating systems:
Android Studio Giraffe (2022.3.1) to Iguana (2023.2.1) is supported.
Qt for Android version 6.7 or later is required.
此 Qt 发行支持下列配置:
分发 | 体系结构 | 编译器 | JDK | Gradle | Package |
---|---|---|---|---|---|
Android 8.0 (API 26) to 14 (API 34) |
arm64-v8a
,
x86_64
,
x86
,和
armeabi-v7a
|
Clang 17.0.2 (NDK r26b 或 26.1.10909125) | JDK 17 | Gradle 8.3 和 AGP 7.4.1 |
Multi-ABI
APK
s and
AAB
s
|
注意: Multi-ABI builds are available only when using CMake. For more information, see CMake Android Multi-ABIs .
注意: It's recommended that Qt apps use the same NDK r26b version used for building these official Qt for Android libraries to avoid missing symbol errors.
The CMake and Ninja versions that are supported are packaged with the version of Qt you are installing.
This plugin is covered by the Qt Community Edition 许可。
The following video covers installing the plugin, installing all the minimum required Qt dependencies for using the plugin, runs through importing an example Qt for Android project, and building and running the project on a target device.
The following sections will cover this information, as well as further details on the plugin's features and UI.
There are two ways to get Qt for Android, but for most users, we recommended the following way:
To download and install Qt for Android, follow the instructions on the 获取并安装 Qt page, and do a custom install that includes at least the minimum requirements:
The following instructions assume you don't want to install Qt Design Studio and Qt Creator . These would normally be installed by default but the instructions here explicitly deselect these and anything not required.
This method should only be used by developers who are working with unreleased or modified Qt builds. It won't be covered here.
This plugin is installed like any other IntelliJ plugin.
The plugin needs to know where certain parts of the Qt toolchain are.
[Qt Folder Path]/<qt version>/android_<architecture>/bin
. Make sure to select the right architecture for the platform you are targeting.
qt-qmake.bat
.
qt-cmake
.
注意: The Additional CMake flags field allows you to modify your projects CMake call.
Use Android Studio's SDK manager to install the correct API, platform, and tools for this version of Qt. See Android SDK .
Test your development setup by running the examples shipped with the Qt installation. You'll need to know your Qt folder path first. When using the Qt Online Installer, the default install locations for the Qt folder are:
The example projects are located under your Qt installation directory in
Qt/Examples/<qt version>/platforms/android/
. To test the examples:
To compile and deploy, select 运行 .
This will build the Qt project and the Android Studio project and run it.
注意: Selecting Make Project will not build the Qt project.
Debugging QML or C++ is not possible with the plugin. For that, see Qt Creator .
Qt version
并选择
OK
.
If you are a returning user or just getting started with QML, the QML 参考 has what you need.
The API documentation for embedding QML in Android applications has specific implementation details and insights into this.