"java.exe" exited with code 1 Error starting xamarin.android application

I am new to xamarin.android applications. I load one map project from http://developer.xamarin.com/samples/MapsAndLocationDemo/ and I try to run the application in visual studio 2013, and when debugging I get an error, for example, "Java.exe", which is output with code 1. I am trying to solve this, but I could not. I also encountered some other problems, finally I solve them. but this error still exists. when i try to find the error it shows the code as below

<CompileToDalvik 
DxJarPath="$(DxJarPath)"
JavaToolPath="$(JavaToolPath)"
JavaMaximumHeapSize="$(JavaMaximumHeapSize)"
JavaOptions="$(JavaOptions)"
ClassesOutputDirectory="$(IntermediateOutputPath)android\bin\classes"
MonoPlatformJarPath="$(MonoPlatformJarPath)"
JavaSourceFiles="@(AndroidJavaSource)" 
JavaLibraries="@(AndroidJavaLibrary)"
ExternalJavaLibraries="@(AndroidExternalJavaLibrary)"
LibraryProjectJars="$(IntermediateOutputPath)__library_projects__\*.jar"
DoNotPackageJavaLibraries="@(_ResolvedDoNotPackageAttributes)"
ToolPath="$(DxToolPath)"
ToolExe="$(DxToolExe)"
UseDx="$(UseDx)"
AdditionalJavaLibraryReferences="@(_AdditionalJavaLibraryReferences)"
/>

"C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets" - , , . .

+4
9

, Java. , " Android" > "Android" > "", Java 1G.

+4

. Progaurd, .

:

-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

proguard.cfg. Android . , Build Action ProguardConfig.

, , UTF-8 NOT UTF-8 BOM

+5

, Xamarin. , sdk Program Files, AppData. "" > "Xamarin" > Android Visual Studio .

+1

, Proguard.cfg.

Proguard.cfg " ". .

+1

HeapSize

Visual Studio > Android Project > a > Android > > Java > 1G

+1

JAVA JDK Tools- > Options- > Xamarin- > JDK, (, C:\Program Files\Java\jdk1.8.0_111).

, .

+1

I had this problem. Instead of trying to fix this by increasing the heap size, I was able to fix it by selecting Build -> Clean Solution and then Rebuild Solution.

0
source
**Error : while running app "Java.exe" exited with code**
I resolved this by manually overriding the java heap size: In Visual Studio: Right-click on Project

->Click andriod properties  
-> Click Android Options
->select Advanced tab
->Advanced android build settings 
Set Java MAx Heap Size to 1G (Or larger depending)

Now the project is under construction. Hope this helps. :)

OR

0
source

Just resolved my issue by unchecking the Enable Proguard option.

Go To : Project Properties > Android Project Options > Android Build > Advanced Tab > Uncheck Enable Proguard
0
source

All Articles