While working on my MonoDroid/Xamarin.Android app, it suddenly stopped building, telling me
"java" exited with code 1.
After turning on normal MSBuild output verbosity, it showed that the error occurred in Xamarin.Android.Common.targets
, located in C:\Program Files (x86)\MSBuild\Xamarin\Android
. The line (line 988) starts this block of xml:
<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)"
/>
Also, when I have the above file open, I have 53 warnings, all similar to:
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]
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 resolved bug 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?
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.
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 this question. 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.