I generated a signed apk with a target sdk version of 30. (Android 11). I know it wasn't officially released but my application is ready for the new changes. I am trying to upload it to the google play console but facing the error:
You uploaded an APK with an invalid signature (learn more about signing). Error from apksigner: 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.
What I tried to do:
Nothing worked. I'm wondering if it's not working since the version wasn't released yet. However, I understand that it suppose to work from the documents.
Short answer for those building Cordova projects on the command line: You'll need to switch from jarsigner
to apksigner
and set up the command accordingly. NOTE: You'll need to run zipalign
before apksigner
, which is different from how we used to use it with jarsigner
. Here's an example:
cordova build android --release
zipalign -f 4 platforms/android/app/build/outputs/apk/release/myapp-release-unsigned.apk myapp.apk
apksigner sign --ks my-ks.keystore --ks-pass file:my-passfile.txt --v1-signing-enabled true --v2-signing-enabled true myapp.apk
... upload apk to store or whatever ...
Select both V1 and V2(Full Apk Signature) while generating the apk. This solved my issue which was similar to yours.
Generate an App Bundle instead of an APK.
In my app I targeted api 30 and published the bundle without problems.
I had a tough time solving that issue. The following helped me resolve it completely.
<preference name="android-minSdkVersion" value="30"/> <preference name="android-targetSdkVersion" value="30"/>
(optional step) You will also see an auto-generated App signing key certificate you can download that if you want
Upload the App Bundle & you can now release the App to PlayStore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With