Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
497 views
in Technique[技术] by (71.8m points)

xamarin - Switching From VS Mac To VS Windows got "java.exe" exited with code 2

Hello Guys

I got an issue when switching my Xamarin.Forms project from VSMac to VsWindows! "java.exe" exited with code 2 when deploying.

I already try:

  • delete bin/ obj/ folders
  • remove all packages and re-add them
  • MultiDex
  • Verify the path (removing special char "!@#$%?&*(-_" etc..)

If you got an idea, tell me ;)

Regards,

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If G Clovs solution doesn't work, then:

  1. make sure the netstandard on your mac is exactly the same on your Windows pc.
  2. Make sure you have the same Android SDK downloaded on your Windows - through Tools Menu > SDK manager.
  3. If you are using stable channel for vs for mac updates, then make sure you are not suing the preview of budget packages on your Windows.
  4. Apply the same logic in 3 for preview channel.

To avoid all these issues:

  1. Simply go to vs for mac 2019, change to stable build and update the vs for mac to latest.
  2. Update all android SDK and build tools to say v28
  3. Update all nugget packages for the two projects and build successfully.
  4. Go to vs 2019 and update vs to latest.
  5. Repeat step 2 for vs.
  6. Deselect preview in nugget package manager, and update nugget packages in the two projects.
  7. Build successful.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...