[Android-tools-devel] Bug#1012451: Bug#1012451: apksigner: Using PKCS11 keystore fails with NoSuchMethodException
dev at dbrgn.ch
dev at dbrgn.ch
Wed Jun 15 16:32:08 BST 2022
With upstream I assume you mean the apksigner binary shipped with the Android build-tools? I tried with build-tools 30.0.2:
$ /opt/android/cmdline-tools/tools/bin/sdkmanager --install "build-tools;30.0.2"
Followed by:
$ /opt/android/build-tools/30.0.2/apksigner sign \
--ks NONE --ks-type PKCS11 \
--ks-pass 0001password --ks-key-alias "APK Signing Cert" \
--provider-class sun.security.pkcs11.SunPKCS11 \
--provider-arg /etc/pkcs11/sunpkcs11_yubihsm2.cfg \
--min-sdk-version 21 --max-sdk-version 31 \
--out apk-release-signed.apk app-release-unsigned.apk
Exception in thread "main" java.lang.NoSuchMethodException: sun.security.pkcs11.SunPKCS11.<init>(java.lang.String)
at java.base/java.lang.Class.getConstructor0(Class.java:3585)
at java.base/java.lang.Class.getConstructor(Class.java:2271)
at com.android.apksigner.ApkSignerTool$ProviderInstallSpec.installProvider(ApkSignerTool.java:1055)
at com.android.apksigner.ApkSignerTool$ProviderInstallSpec.access$200(ApkSignerTool.java:1030)
at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:281)
at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:84)
The line numbers in ApkSignerTool are different, but the error remains. I tried both with Java 17 and 11.
Danilo
More information about the Android-tools-devel
mailing list