Super quick and dirty post about an issue that drove me and another dev crazy for a couple hours. We kept getting this error when trying to archive an Android Xamarin project in Release mode (in Visual Studio 2019), specifically on the signing step:
ERROR: "java.exe" exited with code 2
We noticed a line in the build log which referenced a keystore path that was not a valid path on our machine.
MyApp.Droid project and edit it. In the Release property group, find the
AndroidSigningKeyStore property and make sure it is a valid file path on your machine. If not, don’t update it here. Instead:
- Close and reload the project.
- Right click the
MyApp.Droidproject and click Properties.
- On the Android Package Signing tab, check the box to Sign the .APK… and fill in all four fields.
- Save the project properties.
Try archiving again and it should (hopefully) work. If not, please add a comment to this post and I may be able to help. I may expand this post with more Google Play console errors and their solutions at some point in the future.