8

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

Cássio
  • 181
  • 2
  • 8
  • I am back to the Stable version and the error is gone. – Cássio Aug 22 '18 at 18:31
  • We received a Stable update and the error is presented again. – Cássio Aug 22 '18 at 18:31
  • 1
    I have submitted a problem here: https://developercommunity.visualstudio.com/content/problem/319272/cannot-sign-my-apk-with-the-latest-update-v76-buil.html – karlingen Aug 23 '18 at 08:57
  • 1
    Microsoft are now tracking the issue here https://developercommunity.visualstudio.com/content/problem/317799/major-error-76-build-2190-creates-invalid-apk-for.html – Click Ahead Aug 23 '18 at 09:38

1 Answers1

18

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://learn.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 :)

Click Ahead
  • 2,782
  • 6
  • 35
  • 60
  • 2
    I am getting same error and can't find any good solution. This answer seems correct to me but I can't handle it too because zipalign not recognized. Searched and Tried many solutions for it but no luck, can you help me? – Passionate.C Aug 23 '18 at 05:35
  • 1
    This should help you find and set zipalign https://stackoverflow.com/questions/5327266/zipalign-command-not-found-mac-terminal – Click Ahead Aug 23 '18 at 09:40
  • 1
    I will give @ClickAhead answer as the solution (because it really work) but the real solution must come from the VS4Mac team. Let's keep tracking those links on VS issue tracking. Thank you guys! – Cássio Aug 23 '18 at 13:51
  • very helpful mate, it worked, hopefully the will fix it in the next update of vs4mac – jack Aug 25 '18 at 19:36