You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build a small project based on the qml_minimal example for Android.
It was eventually successful. Some issues were configuration specific, but the Zstd issue relates to how the RCC command is composed in crates/qt-build-utils/src/lib.rs.
The current qml_minimal example has in CMakeLists.txt:
add_executable(example_qml_minimal cpp/main.cpp)
Use qt_add_executable(), instead of add_executable(). Otherwise, Qt doesn't know what to package as the "application".
After this the app compiled successfully both for the emulator (x86_64) and the Android phone (aarch64).
The text was updated successfully, but these errors were encountered:
gambhiro
changed the title
Building on Android fails with undefined symbol: qt_resourceFeatureZstd
Building for Android fails with undefined symbol: qt_resourceFeatureZstd
Apr 6, 2025
This seems like something we can improve by forwarding the options from CMake to our build system, and by allowing you to provide flags to RCC yourself.
I'll note it down for our general build system improvements.
I tried to build a small project based on the
qml_minimal
example for Android.It was eventually successful. Some issues were configuration specific, but the Zstd issue relates to how the RCC command is composed in
crates/qt-build-utils/src/lib.rs
.I installed Qt with the open source online installer to
~/Qt/
.Then installed the Rust targets (
x86_64
is for the emulator such as Genymotion):Cargo should use the correct qmake to find the correct Qt include folders:
In
CMakeLists.txt
:I encountered the following errors:
Error: Missing Qt6QmlImportScanner_DIR
Qt is set to be not found because Qt6QmlImportScanner is not found in the
Qt/6.8.3/android_
folders.In Qt Creator, open Projects > Android Build > Current configuration
Add a
Directory
entry to theInitial Values
tab, so that it will be saved toCMakeLists.txt.user
(TODO: How can this be set in
CMakeLists.txt
?)Error: undefined symbol: qt_resourceFeatureZstd
Zstd compression has to be disabled for the RCC command to produce
.qrc.cpp
files which can compile for Android.The
CMAKE_AUTORCC_OPTIONS
variable was not picked by CXX-Qt fromCMakeLists.txt
, e.g. this didn't work:So I added the options directly in
crates/qt-build-utils/src/lib.rs
As seen in this commit
Error: Not building the APK
(Related: #549)
The current
qml_minimal
example has inCMakeLists.txt
:Use
qt_add_executable()
, instead ofadd_executable()
. Otherwise, Qt doesn't know what to package as the "application".After this the app compiled successfully both for the emulator (
x86_64
) and the Android phone (aarch64
).The text was updated successfully, but these errors were encountered: