Bug 14579 - Xamarin.Android project giving a "Java exited with code 1" error.
Summary: Xamarin.Android project giving a "Java exited with code 1" error.
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.8.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2013-09-09 19:40 UTC by Jon Goldberger [MSFT]
Modified: 2017-06-27 15:49 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Test case (5.28 MB, application/x-zip-compressed)
2013-09-09 19:40 UTC, Jon Goldberger [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jon Goldberger [MSFT] 2013-09-09 19:40:04 UTC
Created attachment 4817 [details]
Test case

I just wanted to see if your team was aware of this issue <http://stackoverflow.com/questions/15397987/why-is-my-monodroid-xamarin-android-project-suddenly-giving-me-a-java-exited>; that I’m running into, and maybe you know of a fix? Your team can feel free to ask me for more info or to try things if needed (maybe best to have discussion through Stack Overflow though). Thanks.

 I’m using VS 2010, although I get the error when using MSBuild from the command line too. Everything compiled fine, and then after installing the latest Xamarin.Android update I started getting the error message:

Error 59 "java.exe" exited with code 1. DPSF Demo for Mono for Android

I tried reverting my code back to an earlier version, but continued to get this error, so the problem is not related to my code, but perhaps to an environmental setting on my machine (or to the new Xamarin.Android version). If I simply unload the “DPSF Demo for Mono for Android” so that it doesn’t build, the rest of my solution builds and runs fine. I’m using Windows 8 x64 with all of the latest updates.

I haven’t tried installing Xamarin.Android on another computer and building there yet, but that is likely my next move.

Any other information I can give you? Thanks.
 Build the solution in Release mode first (I just noticed if you build in Debug mode first it will complain about some .xnb files missing, since they get generated when building in Release mode), and you should see the error message; well, I get the error message at least. If it is a machine-specific problem then you might not get the “java.exe exited with code 1” error.
Comment 2 Jonathan Pryor 2013-09-24 22:06:10 UTC
@Dan: The stackoverflow question doesn't entirely make sense to me, as I don't see why "java exited with code 1" would also prompt MSBuild to go insane and generate those warnings about <PropertyGroup/>. (Or I'm misreading things...)

Regarding "java exited with code 1" specifically, what would be handy is _diagnostic_ build output:


In particular, I'm wondering what command it's executing before things fail. I _assume_ that it's executing dx.jar -- which would be Bug #8137 -- but it could be some other step.

I'm also surprised that setting the $(JavaMaximumHeapSize) MSBuild property didn't work as a workaround.
Comment 3 Chris Hardy [MSFT] 2017-06-27 15:49:28 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Android. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.