[Interest] Android Build fails with Gradle qtGradlePluginType

Daniel Brunner daniel at brunner.ninja
Fri Jul 19 17:58:23 CEST 2024


Hi,

I am using a self-compiled packaged version of Qt6 for android aarch64 and
I experience some issues in the build process after my Qt C++ native code
has been compiled successfully.

The part where it should make an APK out of it fails (see output below)

What can I do in this case?

I am using this packaging of Qt6:
https://aur.archlinux.org/packages/android-aarch64-qt6-base
https://aur.archlinux.org/packages/android-aarch64-qt6-declarative

Best regards

Compile log output

$ /opt/android-libs/aarch64/bin/qt-cmake ../..
-- Android toolchain file within NDK detected:
/opt/android-ndk/build/cmake/android.toolchain.cmake
-- Android toolchain file within NDK detected:
/opt/android-ndk/build/cmake/android.toolchain.cmake
-- The CXX compiler identification is Clang 17.0.2
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler:
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is Clang 17.0.2
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler:
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Deprecation Warning at 3rdparty/qmsgpack/CMakeLists.txt:8
(cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
Qt6 found
Qt6Location not found
-- Performing Test HAVE_EGL
-- Performing Test HAVE_EGL - Success
-- Found EGL:
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include
(found version "1.5")
-- Performing Test HAVE_GLESv2
-- Performing Test HAVE_GLESv2 - Success
-- Found GLESv2:
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include
-- Found WrapVulkanHeaders:
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include
CMake Deprecation Warning at 3rdparty/QtZeroConf/CMakeLists.txt:1
(cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Found Threads: TRUE
-- Found WrapAtomic: TRUE
-- Configuring 'evcharger-app' for the following Android ABIs: arm64-v8a
(default)
-- Found android platform plugin at:
/opt/android-libs/aarch64/./plugins/platforms/libplugins_platforms_qtforandroid_arm64-v8a.so
-- Configuring done (2.2s)
-- Generating done (0.1s)
-- Build files have been written to:
/home/feedc0de/qt-projects/evcharger-app/build/test

cmake --build .
[  0%] Built target QtZeroConf_autogen_timestamp_deps
[  0%] Automatic MOC for target QtZeroConf
.... LOTS OF SUCCESSFUL LINES REMOVED ...
[ 97%] Linking CXX shared module libevcharger-app_arm64-v8a.so
[ 97%] Built target evcharger-app
[ 98%] Built target evcharger-app_lrelease
[ 98%] Built target qt_internal_plugins
[ 98%] Creating APK for evcharger-app
Generating Android Package
  Input file:
/home/feedc0de/qt-projects/evcharger-app/build/test/android-evcharger-app-deployment-settings.json
  Output directory:
/home/feedc0de/qt-projects/evcharger-app/build/test/android-build/
  Application binary: evcharger-app
  Android build platform: android-35
  Install to device: No
Warning: QML import could not be resolved in any of the import paths: QML
Warning: QML import could not be resolved in any of the import paths:
QtQuick.Controls.Windows
Warning: QML import could not be resolved in any of the import paths:
QtQuick.Controls.macOS
Warning: QML import could not be resolved in any of the import paths:
QtQuick.Controls.iOS
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* Where:
Build file
'/home/feedc0de/qt-projects/evcharger-app/build/test/android-build/build.gradle'
line: 17

* What went wrong:
A problem occurred evaluating root project 'android-build'.
> Could not get unknown property 'qtGradlePluginType' for root project
'android-build' of type org.gradle.api.Project.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 4s
Building the android package failed!
  -- For more information, run this command with --verbose.
make[2]: *** [CMakeFiles/evcharger-app_make_apk.dir/build.make:76:
android-build/evcharger-app.apk] Fehler 14
make[1]: *** [CMakeFiles/Makefile2:681:
CMakeFiles/evcharger-app_make_apk.dir/all] Fehler 2
make: *** [Makefile:136: all] Fehler 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240719/e00cca25/attachment.htm>


More information about the Interest mailing list