Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.6.0, 6.7.3, 6.8.0
-
None
-
Ubuntu 20.04 / CMake 3.16 Windows 11
-
-
060a0415e (dev), 1baff69af (6.8), 12e295195 (6.8.0)
-
2024wk48s3FOQtforAndroid
Description
When using Ubuntu 20.04, the system's built-in CMake 3.16 is not able to find the Android SDK API directory when trying to build the notifications_list example:
Running /usr/bin/cmake -S /home/jannejuntunen/workdir/tqtc-android-automotive/examples/base/notifications_list -B /home/jannejuntunen/workdir/tqtc-android-automotive/examples/base/build-notifications_list-Android_Qt_6_6_0_qt6_build_android_install_Clang_x86_64-Debug in /home/jannejuntunen/workdir/tqtc-android-automotive/examples/base/build-notifications_list-Android_Qt_6_6_0_qt6_build_android_install_Clang_x86_64-Debug. CMake Error at /usr/share/cmake-3.16/Modules/Platform/Android-Determine.cmake:170 (message): Android: The API specified by CMAKE_SYSTEM_VERSION='23' does not exist in the NDK. The directory: /home/jannejuntunen/Android/Sdk/ndk/25.1.8937393/platforms/android-23 does not exist. Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:129 (include)
The problem is that the API folder location is not the same as it used to be.
In my case, the wrong folder path is
/home/jannejuntunen/Android/Sdk/ndk/25.1.8937393/platforms/android-23
Whereas the correct one would be:
/home/jannejuntunen/Android/Sdk/platforms/android-23
Apparently, in NDK r22 the directory structure was changed and this has been taken into account in CMake 3.19 onwards:
https://gitlab.kitware.com/cmake/cmake/-/issues/21652
The problem is that Qt's minimum CMake requirement is still 3.16 and this is also used in QtAA sources:
cmake_minimum_required(VERSION 3.16)
The problem went away when I selected CMake 3.24 installed by the Qt installer:
Attachments
Issue Links
- is required for
-
QTBUG-131015 Raise minimum CMake for Android listed in documentation
- Reported
- relates to
-
QTBUG-131169 Bump minimum CMake version to build and use Qt 6.9 to CMake 3.21 or higher for all platforms
- In Progress
- resulted in
-
QTBUG-131015 Raise minimum CMake for Android listed in documentation
- Reported
-
QTBUG-130848 Raise minimum supported CMake version for Android
- Reported
Gerrit Reviews
For Gerrit Dashboard: QTBUG-130760 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
604011,2 | CMake: Bump the minimum CMake version required for Android to 3.21 | dev | qt/qtbase | Status: NEW | +2 | +1 |
601530,5 | Set the minimum CMake version to 3.19 | dev | qt/tqtc-android-automotive | Status: MERGED | +2 | 0 |
601867,2 | Set the minimum CMake version to 3.19 | 6.8 | qt/tqtc-android-automotive | Status: MERGED | +2 | 0 |
602017,2 | Set the minimum CMake version to 3.19 | 6.8.0 | qt/tqtc-android-automotive | Status: MERGED | +2 | 0 |