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

后端 未结 14 2105
生来不讨喜
生来不讨喜 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 05:06

    Disable sign the .APK file using the following keystore details as @Klemikaze

    0 讨论(0)
  • 2020-12-05 05:07

    I only go to option > Build > Android Build and check Enable Multi-Dex it will resolve

    0 讨论(0)
  • 2020-12-05 05:08

    The solution in my case was to disable the "Sign the .APK file using the following keystore details". Because the keystore location and/or password was incorrect, java.exe exited with code 2.

    0 讨论(0)
  • 2020-12-05 05:08

    Reassign the path of the keystore worked for me

    ==EDIT 01==

    Double click on Android Project > Android Package Signing

    On the Keystore path, don't know why but apparently the path was wrong, I re-select the .keystore file again from the same path, and the error "exited with code 2" went away and I was able to Archive for release

    0 讨论(0)
  • 2020-12-05 05:11

    My .csproj file had an entry for the KeyStore that was no longer valid, even thought right-clicking the project and inspecting the properties indicated that I had pointed it to the new location.

    Within .csproj look for all instances of <AndroidSigningKeyStore> and update accordingly.

    0 讨论(0)
  • 2020-12-05 05:13

    I had this error when switching from VS Mac to VS Windows.

    Here the topic Switching From VS Mac To VS Windows got “java.exe” exited with code 2

    The issue was comming from the Android.csproj and the Keystore Path.
    It was set to my Mac Path even if I changed it on

    VSWindows AndroidProject => Properties => Signin

    So I removed this lines on Android.csproj (edited with third text editor):

    <AndroidKeyStore>True</AndroidKeyStore>
    <AndroidSigningKeyStore>YourMacPath/Alias.keystore</AndroidSigningKeyStore>
    <AndroidSigningStorePass>Password</AndroidSigningStorePass>
    <AndroidSigningKeyAlias>Alias</AndroidSigningKeyAlias>
    <AndroidSigningKeyPass>AliasPassword</AndroidSigningKeyPass>
    

    On debug & release Part.

    Then you can edit them on VS Windows.

    Hope I helped someone. See ya

    0 讨论(0)
提交回复
热议问题