Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-130760

CMake 3.16: The API specified by CMAKE_SYSTEM_VERSION='23' does not exist in the NDK.

    XMLWordPrintable

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
    • Android
    • 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) 

      https://codereview.qt-project.org/gitweb?p=qt/tqtc-android-automotive.git;a=blob;f=examples/base/notifications_list/CMakeLists.txt;h=eb54c0a654f0bb6d86cd87480670fc3f32de2cd0;hb=HEAD

      The problem went away when I selected CMake 3.24 installed by the Qt installer: 

       

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-130760
          # Subject Branch Project Status CR V

          Activity

            People

              qtandroidteam Qt Android Team
              jannej Janne Juntunen
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change