androidionic-frameworkkeytooljarsignerzipalign

Ionic apk signing error


Currently trying to sign my apk which has been built with ionic v2 following the exact procedure advised by ionic in their docs: http://ionicframework.com/docs/v1/guide/publishing.html

But for some reason, I am getting this error when uploading to the play console: You uploaded an APK with an invalid signature (learn more about signing). Error from apksigner: ERROR: JAR_SIG_NO_SIGNATURES: No JAR signatures

Was surprised to find very little mention of this error (and none in relation to ionic) on google. What is most bizarre is that I was signing apps no problem a few months ago but only encountering this recently. Can anyone help?


Solution

  • It appears that the APK you're uploading does not contain any JAR signature files. Typically, these are META-INF/MANIFEST.MF, META-INF/<key alias>.SF and META-INF/<key alias>.RSA.

    Try producing a signed APK using apksigner (https://developer.android.com/studio/command-line/apksigner.html) which is the endorsed tool for creating signed APKs:

    zipalign -v -p 4 HelloWorld-release-unsigned.apk HelloWorld.apk
    apksigner sign --ks my-release-key.keystore HelloWorld.apk