How to fix Xamarin.Android build errors with proguard enabled?
<p>Hi I'm trying to reduce my app size by enabling proguard.
Im using Visual Studio 2015, and its a Xamarin.Android App. </p>

<p>I keep getting error :</p>

<pre><code>Java.exe exited with code 1. File: Xamarin.Android.Common.targets.
</code></pre>

<p>All the posts online refer to Gradle, but not sure what gradle means, i think its some kind of plugin but i'm not using that...</p>

<p>Any ideas on a fix? It was working previously with the same project so it is unusual.</p>

<pre><code>&gt;Using "Proguard" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll".
1&gt;Task "Proguard" (TaskId:220)
1&gt;  Task Parameter:ProguardJarPath=C:\SDKS\tools\proguard\lib\proguard.jar (TaskId:220)
1&gt;  Task Parameter:JavaToolPath=C:\PROGRA~1\Java\JDK18~1.0_6\\bin (TaskId:220)
1&gt;  Task Parameter:JavaPlatformJarPath=C:\SDKS\platforms\android-19\android.jar (TaskId:220)
1&gt;  Task Parameter:MonoPlatformJarPath=C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.4\mono.android.jar (TaskId:220)
1&gt;  Task Parameter:ClassesOutputDirectory=obj\Release\android\bin\classes (TaskId:220)
1&gt;  Task Parameter:ProguardCommonXamarinConfiguration=obj\Release\proguard\proguard_xamarin.cfg (TaskId:220)
1&gt;  Task Parameter:ProguardGeneratedReferenceConfiguration=obj\Release\proguard\proguard_project_references.cfg (TaskId:220)
1&gt;  Task Parameter:ProguardGeneratedApplicationConfiguration=obj\Release\proguard\proguard_project_primary.cfg (TaskId:220)
1&gt;  Task Parameter:ProguardConfigurationFiles=
1&gt;          {sdk.dir}tools\proguard\proguard-android.txt;
1&gt;          {intermediate.common.xamarin};
1&gt;          {intermediate.references};
1&gt;          {intermediate.application};
1&gt;          ;
1&gt;       (TaskId:220)
1&gt;  Task Parameter:
1&gt;      LibraryProjectJars=
1&gt;          obj\Release\__library_projects__\Square.OkHttp\library_project_imports\okhttp-2.5.0.jar
1&gt;          obj\Release\__library_projects__\Square.OkIO\library_project_imports\okio-1.6.0.jar (TaskId:220)
1&gt;  Task Parameter:
1&gt;      AdditionalJavaLibraryReferences=
1&gt;          C:\Users\srj\AppData\Local\Xamarin\Android.Support.v4\23.1.1.0\embedded\classes.jar
1&gt;          C:\Users\srj\AppData\Local\Xamarin\Android.Support.v4\23.1.1.0\embedded\libs\internal_impl-23.1.1.jar (TaskId:220)
1&gt;  Task Parameter:ProguardJarInput=obj\Release\proguard\__proguard_input__.jar (TaskId:220)
1&gt;  Task Parameter:ProguardJarOutput=obj\Release\proguard\__proguard_output__.jar (TaskId:220)
1&gt;  Task Parameter:DumpOutput=obj\Release\proguard\dump.txt (TaskId:220)
1&gt;  Task Parameter:PrintSeedsOutput=obj\Release\proguard\seeds.txt (TaskId:220)
1&gt;  Task Parameter:PrintUsageOutput=obj\Release\proguard\usage.txt (TaskId:220)
1&gt;  Task Parameter:PrintMappingOutput=obj\Release\proguard\mapping.txt (TaskId:220)
1&gt;  Proguard (TaskId:220)
1&gt;    JavaPlatformJarPath: C:\SDKS\platforms\android-19\android.jar (TaskId:220)
1&gt;    MonoPlatformJarPath: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.4\mono.android.jar (TaskId:220)
1&gt;    ClassesOutputDirectory: obj\Release\android\bin\classes (TaskId:220)
1&gt;    ProguardGeneratedApplicationConfiguration: obj\Release\proguard\proguard_project_primary.cfg (TaskId:220)
1&gt;    ProguardJarInput: obj\Release\proguard\__proguard_input__.jar (TaskId:220)
1&gt;    ProguardJarOutput: obj\Release\proguard\__proguard_output__.jar (TaskId:220)
1&gt;    ProguardConfigurationFiles: (TaskId:220)
1&gt;      
1&gt;          {sdk.dir}tools\proguard\proguard-android.txt;
1&gt;          {intermediate.common.xamarin};
1&gt;          {intermediate.references};
1&gt;          {intermediate.application};
1&gt;          ;
1&gt;       (TaskId:220)
1&gt;    JavaSourceFiles: (TaskId:220)
1&gt;    JavaLibraries: (TaskId:220)
1&gt;    ExternalJavaLibraries: (TaskId:220)
1&gt;    DoNotPackageJavaLibraries: (TaskId:220)
1&gt;    LibraryProjectJars: (TaskId:220)
1&gt;      obj\Release\__library_projects__\Square.OkHttp\library_project_imports\okhttp-2.5.0.jar (TaskId:220)
1&gt;      obj\Release\__library_projects__\Square.OkIO\library_project_imports\okio-1.6.0.jar (TaskId:220)
1&gt;    UseProguard: False (TaskId:220)
1&gt;    EnableLogging: False (TaskId:220)
1&gt;    DumpOutput: obj\Release\proguard\dump.txt (TaskId:220)
1&gt;    PrintSeedsOutput: obj\Release\proguard\seeds.txt (TaskId:220)
1&gt;    PrintMappingOutput: obj\Release\proguard\mapping.txt (TaskId:220)
1&gt;  Environment Variables passed to tool: (TaskId:220)
1&gt;    java_tool_options= -Dfile.encoding=UTF8 (TaskId:220)
1&gt;    proguard_home=C:\SDKS\tools\proguard (TaskId:220)
1&gt;  C:\PROGRA~1\Java\JDK18~1.0_6\\bin\java.exe -jar C:\SDKS\tools\proguard\lib\proguard.jar -include C:\SDKS\tools\proguard\proguard-android.txt -include obj\Release\proguard\proguard_xamarin.cfg -include obj\Release\proguard\proguard_project_references.cfg -include obj\Release\proguard\proguard_project_primary.cfg "-injars 'obj\Release\proguard\__proguard_input__.jar';'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.4\mono.android.jar';'obj\Release\__library_projects__\Square.OkHttp\library_project_imports\okhttp-2.5.0.jar';'obj\Release\__library_projects__\Square.OkIO\library_project_imports\okio-1.6.0.jar';'C:\Users\srj\AppData\Local\Xamarin\Android.Support.v4\23.1.1.0\embedded\classes.jar';'C:\Users\srj\AppData\Local\Xamarin\Android.Support.v4\23.1.1.0\embedded\libs\internal_impl-23.1.1.jar'" "-libraryjars 'C:\SDKS\platforms\android-19\android.jar'" -outjars "obj\Release\proguard\__proguard_output__.jar"  (TaskId:220)
1&gt;  ProGuard, version 4.7 (TaskId:220)
1&gt;  Reading input... (TaskId:220)
1&gt;  Reading program jar [C:\Projects\cpxm\Product\Production\ColorPoint.Xamarin.Android\obj\Release\proguard\__proguard_input__.jar] (TaskId:220)
1&gt;  Reading program jar [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.4\mono.android.jar] (TaskId:220)
1&gt;  Reading program jar [C:\Projects\cpxm\Product\Production\ColorPoint.Xamarin.Android\obj\Release\__library_projects__\Square.OkHttp\library_project_imports\okhttp-2.5.0.jar] (TaskId:220)
1&gt;  Reading program jar [C:\Projects\cpxm\Product\Production\ColorPoint.Xamarin.Android\obj\Release\__library_projects__\Square.OkIO\library_project_imports\okio-1.6.0.jar] (TaskId:220)
1&gt;  Reading program jar [C:\Users\srj\AppData\Local\Xamarin\Android.Support.v4\23.1.1.0\embedded\classes.jar] (TaskId:220)
1&gt;  Reading program jar [C:\Users\srj\AppData\Local\Xamarin\Android.Support.v4\23.1.1.0\embedded\libs\internal_impl-23.1.1.jar] (TaskId:220)
1&gt;  Reading library jar [C:\SDKS\platforms\android-19\android.jar] (TaskId:220)
1&gt;  Initializing... (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'android.support.v4.app.ActivityCompat$OnRequestPermissionsResultCallback' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'android.support.v4.app.FragmentManager$BackStackEntry' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'android.support.v4.app.FragmentManager$OnBackStackChangedListener' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'mono.android.support.v4.app.FragmentManager_OnBackStackChangedListenerImplementor' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'android.support.v4.app.LoaderManager$LoaderCallbacks' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'android.support.v4.app.SharedElementCallback' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'android.support.v4.content.Loader$OnLoadCanceledListener' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'android.support.v4.content.Loader$OnLoadCompleteListener' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'android.support.v4.media.session.MediaControllerCompat$Callback' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'android.support.v4.media.session.MediaSessionCompat$Callback' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'android.support.v4.media.session.MediaSessionCompat$OnActiveChangeListener' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'mono.android.support.v4.media.session.MediaSessionCompat_OnActiveChangeListenerImplementor' (TaskId:220)
1&gt;  Note: the configuration doesn't specify which class members to keep for class 'android.support.v4.media.VolumeProviderCompat' (TaskId:220)
1&gt;PROGUARD : warning : okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Files
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Files
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Files
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Path
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.OpenOption
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Path
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.OpenOption
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Path
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.OpenOption
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Path
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.OpenOption
1&gt;PROGUARD : warning : okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
1&gt;  Note: android.support.v4.text.ICUCompatApi23: can't find dynamically referenced class libcore.icu.ICU (TaskId:220)
1&gt;  Note: android.support.v4.text.ICUCompatIcs: can't find dynamically referenced class libcore.icu.ICU (TaskId:220)
1&gt;  Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class com.android.org.conscrypt.OpenSSLSocketImpl (TaskId:220)
1&gt;  Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl (TaskId:220)
1&gt;  Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class android.net.Network (TaskId:220)
1&gt;  Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'icon' dynamically (TaskId:220)
1&gt;        Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { int icon; }' (TaskId:220)
1&gt;        Maybe this is program field 'colorpoint.xamarin.xandroid.R$drawable { int icon; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.R$attr { int icon; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.R$id { int icon; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.app.LauncherActivity$ListItem { android.graphics.drawable.Drawable icon; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.app.Notification { int icon; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.app.Notification$Action { int icon; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.appwidget.AppWidgetProviderInfo { int icon; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.content.pm.PackageItemInfo { int icon; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.content.pm.ResolveInfo { int icon; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.inputmethodservice.Keyboard$Key { android.graphics.drawable.Drawable icon; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.speech.tts.TextToSpeech$EngineInfo { int icon; }' (TaskId:220)
1&gt;  Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'title' dynamically (TaskId:220)
1&gt;        Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { java.lang.CharSequence title; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.R$attr { int title; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.R$id { int title; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.app.Notification$Action { java.lang.CharSequence title; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.preference.PreferenceActivity$Header { java.lang.CharSequence title; }' (TaskId:220)
1&gt;  Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'actionIntent' dynamically (TaskId:220)
1&gt;        Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { android.app.PendingIntent actionIntent; }' (TaskId:220)
1&gt;        Maybe this is library field 'android.app.Notification$Action { android.app.PendingIntent actionIntent; }' (TaskId:220)
1&gt;  Note: the configuration refers to the unknown class 'com.google.vending.licensing.ILicensingService' (TaskId:220)
1&gt;  Note: the configuration refers to the unknown class 'com.android.vending.licensing.ILicensingService' (TaskId:220)
1&gt;  Note: the configuration keeps the entry point 'android.support.v4.media.session.MediaSessionCompat { MediaSessionCompat(android.content.Context,android.support.v4.media.session.MediaSessionCompat$MediaSessionImpl); }', but not the descriptor class 'android.support.v4.media.session.MediaSessionCompat$MediaSessionImpl' (TaskId:220)
1&gt;  Note: the configuration keeps the entry point 'android.support.v4.media.session.MediaSessionCompat$QueueItem { MediaSessionCompat$QueueItem(android.os.Parcel,android.support.v4.media.session.MediaSessionCompat$1); }', but not the descriptor class 'android.support.v4.media.session.MediaSessionCompat$1' (TaskId:220)
1&gt;  Note: there were 2 references to unknown classes. (TaskId:220)
1&gt;        You should check your configuration for typos. (TaskId:220)
1&gt;  Note: there were 2 unkept descriptor classes in kept class members. (TaskId:220)
1&gt;        You should consider explicitly keeping the mentioned classes (TaskId:220)
1&gt;        (using '-keep'). (TaskId:220)
1&gt;  Note: there were 5 unresolved dynamic references to classes or interfaces. (TaskId:220)
1&gt;        You should check if you need to specify additional program jars. (TaskId:220)
1&gt;  Note: there were 3 accesses to class members by means of introspection. (TaskId:220)
1&gt;        You should consider explicitly keeping the mentioned class members (TaskId:220)
1&gt;        (using '-keep' or '-keepclassmembers'). (TaskId:220)
1&gt;PROGUARD : warning : there were 14 unresolved references to classes or interfaces.
1&gt;           You may need to specify additional library jars (using '-libraryjars'). (TaskId:220)
1&gt;  java.io.IOException: Please correct the above warnings first. (TaskId:220)
1&gt;      at proguard.Initializer.execute(Initializer.java:321) (TaskId:220)
1&gt;      at proguard.ProGuard.initialize(ProGuard.java:211) (TaskId:220)
1&gt;      at proguard.ProGuard.execute(ProGuard.java:86) (TaskId:220)
1&gt;      at proguard.ProGuard.main(ProGuard.java:492) (TaskId:220)
1&gt;  Picked up JAVA_TOOL_OPTIONS:  -Dfile.encoding=UTF8 (TaskId:220)
1&gt;C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1845,3): error MSB6006: "java.exe" exited with code 1.
1&gt;Done executing task "Proguard" -- FAILED. (TaskId:220)
1&gt;Done building target "_CompileToDalvik" in project "ColorPoint.Xamarin.XAndroid.csproj" -- FAILED.: (TargetId:139)
1&gt;
</code></pre>