When I was trying to build an Xamarin Android app with Release configuration in Visual Studio 2017, I got an error saying..
error MSB6006: “java.exe” exited with code 1.
Then I looked for how to solve the error and I found that the issue happen because of Proguard is enabled.

Image 1 : Android options for release configuration
Then I found 2 solutions to solve the issue.
- Set Java Max Heap Size in Android options.
- Change format of Java Max Heap Size in Android options.(Use M/G instead of MB/GB)
- Add a custom Proguard configuration file.
I tried first 2 options but, it didn’t solve the issue.

Image 2 : Change max heap size manually (option 1 and 2)
Final Solution.
The issue solved when I add a Proguard configuration file manually.
Steps to add a Proguard configuration file manually.
-
- Go to Android project
- Create new file call proguard.cfg
- Right Click on proguard.cfg file and go to properties.
- Change build action to Proguard Configuration.
- Open the file and add below code..
- Save and Re-Build the Android Project..

Image 3 : Change build action of proguard.cfg
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

Image 4 : code in proguard.cfg
Thanks !
Reference
https://stackoverflow.com/questions/38147828/java-exe-exited-with-code-1-proguard-issue