'How to sign Android APK using v2 signature in Ionic 3 CLI?
I am trying to upload a new build for Ionic 3 app. Now the Google Play Store is asking me to target minSDK 30 which is have done. But now the Google Play Store is returning message:
ERROR: MIN_SIG_SCHEME_FOR_TARGET_SDK_NOT_MET: Target SDK version 30 requires a minimum of signature scheme v2; the APK is not signed with this or a later signature scheme.
I tried to sign using apksigner but whenever I run the command I get error as Atleast one signer must be specified.
I did the following steps;
ionic cordova build android --prod --release
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore HelloWorld-release-unsigned.apk alias_name
zipalign -v -p 4 HelloWorld-release-unsigned.apk HelloWorld.apk
apksigner sign --ks my-release-key.keystore HelloWorld.apk
I can use the zip align but cannot sign using apksigner. Please help
Solution 1:[1]
Generate an App Bundle instead of an APK:
ionic cordova build android --prod --release -- -- --packageType=bundle
And then sign in with .jks
jarsigner -sigalg SHA256withRSA -digestalg SHA-256 -keystore app.jks AppName.aab AppName
or .keystore
jarsigner -sigalg SHA256withRSA -digestalg SHA-256 -keystore app.keystore AppName.aab AppName
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tomislav Stankovic |
