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

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

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes