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

Multi-ABI Android builds only work on base kit arch

    XMLWordPrintable

Details

    • Android
    • e59308c51 (dev), 6e3d2ad44 (6.9), e0e0854b0 (6.8)
    • 2024wk48s3FOQtforAndroid, 2024wk50s3FOQtforAndroid

    Description

      As of Qt 6.8.1, Qt attempts to load the libraries of the kit used to build the multi-ABI build instead of the architecture of the target. So a multi-ABI build running on an arm64-v8a target needs to be built with the arm64-v8a kit for it to work. Kind of a single-ABI build really.

      To reproduce on an arm64-v8a target arch, but using x86 as the "default" (change to whatever your architecture actually isn't):

      ~/Qt/6.8.1/android_x86/bin/qt-cmake -S . -B build -G Ninja -DQT_ANDROID_BUILD_ALL_ABIS=ON
      cd build
      ninja
      adb install android-build/build/outputs/apk/debug/android-build-debug.apk

       

      We can see from logcat that an attempt is made to load the wrong libs (should be arm64-v8a):

      11-28 13:28:13.482  9637  9660 E QtLoader: Can't find '/data/app/~~XXJdaucVluTCOsLx9g62Ng==/io.qt.coffeemachine-EczgdV7YEhUxQBZccnJ7YA==/lib/arm64/libplugins_platforms_qtforandroid_x86.so'
      11-28 13:28:13.482  9637  9637 E QtLoader: Loading Qt native libraries failed

       

      And the application doesn't start. The wrong libs can be seen in the build directory too (android-build/res/values/libs.xml):

          <array name="load_local_libs">
              <item>x86_64;libplugins_platforms_qtforandroid_x86.so</item>
              <item>x86;libplugins_platforms_qtforandroid_x86.so</item>
              <item>arm64-v8a;libplugins_platforms_qtforandroid_x86.so</item>
              <item>armeabi-v7a;libplugins_platforms_qtforandroid_x86.so</item>
          </array>

      This is a regression from Qt 6.8.0, where multi-ABI builds worked perfectly. Reverting https://codereview.qt-project.org/c/qt/qtbase/+/602273 seems to be a quick fix.

      Attachments

        Issue Links

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

          Activity

            People

              bartlomiejmoskal Bartlomiej Moskal
              olvuolte Olli Vuolteenaho
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes