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

CMake code for locating latest android.jar in Android SDK is incorrect

    XMLWordPrintable

Details

    • Android
    • 6036b9c706faf3f94715566e8b3b97c65271bc16 (qt/qtbase/6.2) 95ccdfa432 (qt/tqtc-qtbase/6.3)

    Description

      When compiling jars for Android platform, Qt uses hardcoded platform version when locating android.jar. If hardcoded platform version is not found, it tries to find the latest version available: https://github.com/qt/qtbase/blob/v6.2.1/cmake/QtPlatformAndroid.cmake#L36.

      There is a problem with this code, though - it uses lexicographic comparison for version numbers, which means if, for example, hardcoded version is "android-30" and "sdk/platforms" directory contains "android-9" and "android-31" then Qt will use "android-9" platform for jars compilation and build will fail.

      AFAIK "COMPARE NATURAL" option that was added to "list(SORT)" in CMake 3.18 should fix this but IIRC minimal version for Qt build is lower.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jbornema Joerg Bornemann
            equeim Alexey
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes