title: xamarin.forms java.exe exited with code 2 in vs 2017
body: <p>I'm getting this error in my xamarin.forms project which is so annoying, 'cause I've tried all the following solutions but none of them worked!!!</p>
  
  <ul>
  <li>Enabled Multi-Dex</li>
  <li>Set max heap size to 1G (even 5G)</li>
  <li>Disabled sign .apk</li>
  <li>updated all the nuget packages(xamarin.android.support packages which is actually what caused this error in the first place!)</li>
  <li>I also updated JDK!!
  does anybody have any solutions rather than all the above?</li>
  </ul>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is the full error:</p>
  
  <pre><code>10&gt;"C:\Users\Home\Desktop\Vebko\Vebko\Vebko.Android\Vebko.Android.csproj" (Rebuild;BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;DebugSymbolsProjectOutputGroup;DebugSymbolsProjectOutputGroupDependencies;DocumentationProjectOutputGroup;DocumentationProjectOutputGroupDependencies;SatelliteDllsProjectOutputGroup;SatelliteDllsProjectOutputGroupDependencies;SGenFilesOutputGroup;SGenFilesOutputGroupDependencies target) (1) -&gt;
  10&gt;(_CompileToDalvikWithDx target) -&gt; 
  10&gt;  CREATEMULTIDEXMAINDEXCLASSLIST : warning : can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [commons-lang3-3.5.jar:META-INF/LICENSE.txt])
  10&gt;  CREATEMULTIDEXMAINDEXCLASSLIST : warning : can't write resource [META-INF/NOTICE.txt] (Duplicate zip entry [commons-lang3-3.5.jar:META-INF/NOTICE.txt])
  10&gt;
  10&gt;
  10&gt;"C:\Users\Home\Desktop\Vebko\Vebko\Vebko.Android\Vebko.Android.csproj" (Rebuild;BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;DebugSymbolsProjectOutputGroup;DebugSymbolsProjectOutputGroupDependencies;DocumentationProjectOutputGroup;DocumentationProjectOutputGroupDependencies;SatelliteDllsProjectOutputGroup;SatelliteDllsProjectOutputGroupDependencies;SGenFilesOutputGroup;SGenFilesOutputGroupDependencies target) (1) -&gt;
  10&gt;(_CompileToDalvikWithDx target) -&gt; 
  10&gt;  C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2610,3): error MSB6006: "java.exe" exited with code 2.
  10&gt;
  10&gt;    260 Warning(s)
  10&gt;    1 Error(s)
  10&gt;
  10&gt;Time Elapsed 00:01:23.09
  ========== Rebuild All: 9 succeeded, 1 failed, 1 skipped ==========
  </code></pre>