Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is my MonoDroid/Xamarin.Android project suddenly giving me a "'java' exited with code 1." error?
    text
    copied!<p>While working on my MonoDroid/Xamarin.Android app, it suddenly stopped building, telling me</p> <pre><code>"java" exited with code 1. </code></pre> <p>After turning on normal MSBuild output verbosity, it showed that the error occurred in <code>Xamarin.Android.Common.targets</code>, located in <code>C:\Program Files (x86)\MSBuild\Xamarin\Android</code>. The line (line 988) starts this block of xml:</p> <pre><code>&lt;CompileToDalvik JavaMaximumHeapSize="$(JavaMaximumHeapSize)" JavaOptions="$(JavaOptions)" AndroidSdkDirectory="$(_AndroidSdkDirectory)" ClassesOutputDirectory="$(IntermediateOutputPath)android\bin\classes" JavaSdkDirectory="$(_JavaSdkDirectory)" MonoPlatformJarPath="$(MonoPlatformJarPath)" JavaSourceFiles="@(AndroidJavaSource)" JavaLibraries="@(AndroidJavaLibrary)" LibraryProjectJars="$(IntermediateOutputPath)__library_projects__\*.jar" UseDx="$(UseDx)" /&gt; </code></pre> <p>Also, when I have the above file open, I have 53 warnings, all similar to:</p> <pre><code>The element 'PropertyGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'ResolveReferencesDependsOn' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Property, AllowUnsafeBlocks, ... [followed by a long list of elements] </code></pre> <p>I deleted all the code that I had recently added, then ended up doing a full revert to previous code that worked, but the error continues no matter what I do. I found a <a href="https://bugzilla.xamarin.com/show_bug.cgi?id=8137" rel="nofollow noreferrer">resolved bug</a> that may occur on the same line, but the solution given there didn't work for me. Also, because of the warnings and the fact that my code used to work it its current revision, it doesn't seem to be the same problem. Any ideas why this would happen, and how I might fix it?</p> <p>More details: I tried running a new M4A project and it worked fine, so it looks like it isn't a problem with the M4A file, but something my code.</p> <p>Even more details: I was going through each class, commenting them out to see if I could find a particular block that was causing the problem, when the error suddenly changed. It now displays an error identical to the one found in <a href="https://stackoverflow.com/questions/15163492/cannot-find-symbol-fastdevlauncher-blocking-deployment-to-android-emulator">this question</a>. I am also using the 30-day trial. However, I am using Visual Studio. I'll be seeing if the answer and comments there will help me too.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload