Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.4.0
-
None
-
-
9c56a7702 (dev), 257f142b8 (6.5), 9d7131f5e (6.4), fd2c408af (dev), 589661c0d (6.8), b9e749331 (6.7), bff24119d (tqtc/lts-6.5)
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
For Gerrit Dashboard: QTBUG-109619 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
450543,3 | Move '--sign' argument to the end of the androiddeployqt command | dev | qt/qtbase | Status: MERGED | +2 | 0 |
451374,2 | Move '--sign' argument to the end of the androiddeployqt command | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
451375,3 | Move '--sign' argument to the end of the androiddeployqt command | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |
584562,2 | androiddeployqt: Fix the --sign argument handling ordering | dev | qt/qtbase | Status: MERGED | +2 | +1 |
584665,2 | androiddeployqt: Fix the --sign argument handling ordering | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |
584708,2 | androiddeployqt: Fix the --sign argument handling ordering | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
584821,2 | androiddeployqt: Fix the --sign argument handling ordering | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |