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

Enabling 2 extra Android CMake options leads to a build error

    XMLWordPrintable

Details

    • Android
    • 9c56a7702 (dev), 257f142b8 (6.5), 9d7131f5e (6.4)

    Description

      Qt Android CMake enables to generate signed release APK/AAB by setting the following options:
       

      set(QT_ANDROID_SIGN_APK ON CACHE BOOL" Sign Android APK") set(QT_ANDROID_SIGN_AAB ON CACHE BOOL "Sign Android AAB")

       This leads to the invocation of androiddeployqt with the  --sign argument and this assumes that one has set the 4 QT_ANDROID_KEYSTORE*_ environment variables.
       
      If one enables QT_ENABLE_VERBOSE_DEPLOYMENT and QT_INTERNAL_NO_ANDROID_RCC_BUNDLE_CLEANUP

       

      set(QT_ENABLE_VERBOSE_DEPLOYMENT ON CACHE BOOL "Android verbose") set(QT_INTERNAL_NO_ANDROID_RCC_BUNDLE_CLEANUP ON CACHE BOOL "Bundle cleanup")

       
      then Qt Android CMake appends 2 extra arguments to androiddeployqt command line and, in this case, androiddeployqt assumes this 2 extra arguments as being the keystore path and the keystore alias.

      This leads androiddeployqt to fail because apksigner fails:
      Failed to load signer "signer #1"
      java.io.FileNotFoundException: --no-rcc-bundle-cleanup (No such file or directory)
      at java.base/java.io.FileInputStream.open0(Native Method)
      at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
      at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
      at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
      at com.android.apksigner.SignerParams.loadKeyStoreFromFile(SignerParams.java:361)
      at com.android.apksigner.SignerParams.loadPrivateKeyAndCertsFromKeyStore(SignerParams.java:248)
      at com.android.apksigner.SignerParams.loadPrivateKeyAndCerts(SignerParams.java:181)
      at com.android.apksigner.ApkSignerTool.getSignerConfig(ApkSignerTool.java:419)
      at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:336)
      at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:92)
      apksigner command failed.
      -- Run with --verbose for more information.
      ninja: build stopped: subcommand failed.

      Qt6AndroidMacros.cmake could be patched so ${sign_apk} (--sign) is always passed as the last argument of androiddeployqt.

      androiddeployqt could perform a stronger check of its command line arguments so --sign argument may be positioned anywhere on the command line.

      Attachments

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

        Activity

          People

            semlanik Alexey Edelev
            malocode David Audrain
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes