“java.exe” exited with code 2 Xamarin.Android project

后端 未结 14 2103
生来不讨喜
生来不讨喜 2020-12-05 04:38

so I have my Xamarin.Android project which contains several libraries. When I try to build I receive an error which says \"java.exe\" exited with code 2.

After some

14条回答
  •  攒了一身酷
    2020-12-05 04:51

    I've struggled with this issue for quite a long time. I found source of the error in signing - as I cloned project repo from company TFS, Android csproj file had entries for KeyStore settings and location. I didn't have the keystore and the location on my drive was invalid. Visual Studio is then unable to sign the app while deploying and instead of some sort of FileNotFoundException it gave me just java exited with code 2. So...

    tl;dr: Go to android project properties, select package signing a uncheck "Sign the apk file..." (which changes csproj true to false) and voila, you can now run your solution.

提交回复
热议问题