Home » Android » Error signing and uploading APK on Xamarin.Android 9 and Visual Studio for Mac Beta

Error signing and uploading APK on Xamarin.Android 9 and Visual Studio for Mac Beta

Posted by: admin June 15, 2020 Leave a comment

Questions:

Just updated to the Beta Channel of VS4Mac and now when I’m attempting to upload the new APK this erros occurs.

Error: uploading ‘package.name’
APK signature is invalid or does not exist. Error from apksigner: ERROR (Jar signer APPNAME.RSA): Jar signature META-INF/APPNAME.SF indicates the APK is signed using APK Signature Schema v2 but no such signature was found. Signature stripped?

enter image description here

How to&Answers:

I’ve run into this issue myself today. After spending the entire day trying to resolve it, I decided to try and manually sign the cert, which works. I can only guess that the latest build of Xamarin has some issue around apk siging.

Anyway, to manually sign the apk, here is a good article
https://docs.microsoft.com/en-us/xamarin/android/deploy-test/signing/manually-signing-the-apk

In my case, I took the APK that was built and archived and then ran the following commands:

  1. zipalign -f -v 4 yourapk.apk yournewapk.apk
  2. apksigner sign –ks yourkeystore.keystore –ks-key-alias YourKeyStoreAlias yourapk.apk

You might need to add zipalign to your bash profile.

Anyway, it’s not ideal but at least I can now deploy my apk and head to bed 🙂