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

androiddeployqt does not consider split APKs and cannot sign them

XMLWordPrintable

    • Android
    • 2024wk52FOQtforAndroid

      No particular reproducer provided since the issue is about building tool itself. Any arbitrary project can be used for testing.

      When building for multiple ABIs, it's possible to split APKs, i.e. one APK for one ABI instead of a single "integrated" APK for all ABIs. It is done by:
      1. Specify ANDROID_ABIS or QT_ANDROID_ABIS depending on if one's using Qt5 or Qt6
      2. Add the following entry to build.gradle (v7a and v8a for instance) to android section:

      splits {
      abi {
      enable true
      reset()
      include "armeabi-v7a", "arm64-v8a"
      universalApk false
      }
      }
      

      The problem is that under Release mode, they cannot be signed due to errors:

      Unable to open 'D:/build-Android_playground-Android_Qt_6_6_2_Clang_arm64_v8a-Release/android-build//build/outputs/apk/release/android-build-release-unsigned.apk' for verification
      Unable to open 'D:/build-Android_playground-Android_Qt_6_6_2_Clang_arm64_v8a-Release/android-build//build/outputs/apk/release/android-build-release-unsigned.apk' as zip archive
      zipalign command failed.
      

      A guess about the reason:
      Implementation of the packagePath method in androiddeployqt. There is no accounting for the additional target ABI string in the resulting APK filenames in this method and so the signing process fails. As above, the zipalign command expects a file called android-build-release-unsigned.apk when the file is actually called android-build-<TARGET_ABI>-release-unsigned.apk

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

            qtandroidteam Qt Android Team
            luqiaochen Luqiao Chen
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes