Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

New "java.exe" exited with Code 2 error

RobClotherRobClother GBUniversity ✭✭

After the most recent update (Xamarin.Android.Support libraries, V28.0.0, Build tools 27.0.3), every build is failing with

"java.exe" exited with Code 2

I had previously enabled Multi-Dex to get rid of this issue, and that has worked without a problem until now. I also tried re-enabling ProGuard, and following all of the steps from this answer, including the change to MainDexClasses.bat.

There are a couple of new warnings, but I haven't been able to work out whether or not they are causing the new problem:

CREATEMULTIDEXMAINDEXCLASSLIST: warning : can't write resource [META-INF/maven/com.squareup.okio/okio/pom.xml] (Duplicate zip entry [okio.jar:META-INF/maven/com.squareup.okio/okio/pom.xml])

CREATEMULTIDEXMAINDEXCLASSLIST: warning : can't write resource [META-INF/maven/com.squareup.okio/okio/pom.properties] (Duplicate zip entry [okio.jar:META-INF/maven/com.squareup.okio/okio/pom.properties])

Answers

  • RobClotherRobClother GBUniversity ✭✭
    edited December 2018

    Changing the Target Android Version (Project Properties -> Android Manifest) from "Android 9.0" to "Use Compile using SDK Version" seemed to fix the issue, but it broke again when I tried to deploy to my device.

  • RobClotherRobClother GBUniversity ✭✭
    edited December 2018

    Diagnostic output:

    4>      No way to resolve conflict between "System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing "System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
    4>      C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.9\\bin\javac.exe -J-Dfile.encoding=UTF8 -d obj\Debug\android\bin\classes -classpath "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\mono.android.jar;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\android-support-multidex.jar;obj\Debug\lp\0\jl\bin\classes.jar;obj\Debug\lp\100\jl\bin\classes.jar;obj\Debug\lp\101\jl\bin\classes.jar;obj\Debug\lp\102\jl\bin\classes.jar;obj\Debug\lp\103\jl\bin\classes.jar;obj\Debug\lp\104\jl\bin\classes.jar;obj\Debug\lp\116\jl\android.arch.core.common.jar;obj\Debug\lp\117\jl\bin\classes.jar;obj\Debug\lp\118\jl\android.arch.lifecycle.common.jar;obj\Debug\lp\119\jl\bin\classes.jar;obj\Debug\lp\120\jl\bin\classes.jar;obj\Debug\lp\121\jl\bin\classes.jar;obj\Debug\lp\122\jl\bin\classes.jar;obj\Debug\lp\125\jl\bin\classes.jar;obj\Debug\lp\126\jl\com.android.support.support-annotations.jar;obj\Debug\lp\127\jl\bin\classes.jar;obj\Debug\lp\128\jl\com.android.support.collections.jar;obj\Debug\lp\129\jl\bin\classes.jar;obj\Debug\lp\130\jl\bin\classes.jar;obj\Debug\lp\131\jl\bin\classes.jar;obj\Debug\lp\132\jl\bin\classes.jar;obj\Debug\lp\133\jl\bin\classes.jar;obj\Debug\lp\134\jl\bin\classes.jar;obj\Debug\lp\135\jl\bin\classes.jar;obj\Debug\lp\136\jl\bin\classes.jar;obj\Debug\lp\137\jl\bin\classes.jar;obj\Debug\lp\138\jl\bin\classes.jar;obj\Debug\lp\139\jl\bin\classes.jar;obj\Debug\lp\140\jl\bin\classes.jar;obj\Debug\lp\141\jl\bin\classes.jar;obj\Debug\lp\142\jl\bin\classes.jar;obj\Debug\lp\143\jl\bin\classes.jar;obj\Debug\lp\144\jl\bin\classes.jar;obj\Debug\lp\145\jl\bin\classes.jar;obj\Debug\lp\146\jl\bin\classes.jar;obj\Debug\lp\147\jl\bin\classes.jar;obj\Debug\lp\148\jl\bin\classes.jar;obj\Debug\lp\149\jl\bin\classes.jar;obj\Debug\lp\150\jl\bin\classes.jar;obj\Debug\lp\151\jl\bin\classes.jar;obj\Debug\lp\152\jl\bin\classes.jar;obj\Debug\lp\153\jl\bin\classes.jar;obj\Debug\lp\154\jl\bin\classes.jar;obj\Debug\lp\155\jl\bin\classes.jar;obj\Debug\lp\156\jl\bin\classes.jar;obj\Debug\lp\157\jl\bin\classes.jar;obj\Debug\lp\158\jl\bin\classes.jar;obj\Debug\lp\160\jl\classes.jar;obj\Debug\lp\161\jl\classes.jar;obj\Debug\lp\162\jl\classes.jar;obj\Debug\lp\163\jl\classes.jar;obj\Debug\lp\164\jl\classes.jar;obj\Debug\lp\165\jl\classes.jar;obj\Debug\lp\172\jl\classes.jar;obj\Debug\lp\173\jl\classes.jar;obj\Debug\lp\174\jl\classes.jar;obj\Debug\lp\175\jl\classes.jar;obj\Debug\lp\176\jl\classes.jar;obj\Debug\lp\177\jl\classes.jar;obj\Debug\lp\178\jl\classes.jar;obj\Debug\lp\179\jl\classes.jar;obj\Debug\lp\19\jl\formsviewgroup.jar;obj\Debug\lp\25\jl\bin\classes.jar;obj\Debug\lp\27\jl\bin\classes.jar;obj\Debug\lp\28\jl\bin\classes.jar;obj\Debug\lp\30\jl\bin\classes.jar;obj\Debug\lp\80\jl\okhttp3.jar;obj\Debug\lp\81\jl\okio.jar;obj\Debug\lp\99\jl\bin\classes.jar" -bootclasspath "C:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar" -encoding UTF-8 "@C:\Users\white\AppData\Local\Temp\tmpF53D.tmp" -target 1.7 -source 1.7 
    4>      C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.9\\bin\java.exe -jar "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\proguard\lib\proguard.jar" -injars "'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\mono.android.jar'(!META-INF/MANIFEST.MF);'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\android-support-multidex.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\0\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\100\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\101\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\102\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\103\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\104\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\116\jl\android.arch.core.common.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\117\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\118\jl\android.arch.lifecycle.common.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\119\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\120\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\121\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\122\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\125\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\126\jl\com.android.support.support-annotations.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\127\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\128\jl\com.android.support.collections.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\129\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\130\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\131\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\132\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\133\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\134\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\135\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\136\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\137\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\138\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\139\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\140\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\141\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\142\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\143\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\144\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\145\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\146\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\147\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\148\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\149\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\150\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\151\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\152\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\153\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\154\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\155\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\156\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\157\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\158\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\160\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\161\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\162\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\163\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\164\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\165\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\172\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\173\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\174\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\175\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\176\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\177\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\178\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\179\jl\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\19\jl\formsviewgroup.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\25\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\27\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\28\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\30\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\80\jl\okhttp3.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\81\jl\okio.jar'(!META-INF/MANIFEST.MF);'obj\Debug\lp\99\jl\bin\classes.jar'(!META-INF/MANIFEST.MF);'obj\Debug\android\bin\classes\..\classes.zip'(!META-INF/MANIFEST.MF)" -dontwarn -forceprocessing -outjars C:\Users\white\AppData\Local\Temp\j2tf20ug.wvi.jar -libraryjars "'C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\lib\shrinkedAndroid.jar'" -dontoptimize -dontobfuscate -dontpreverify -include "'C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\mainDexClasses.rules'" 
    4>CREATEMULTIDEXMAINDEXCLASSLIST: warning : can't write resource [META-INF/maven/com.squareup.okio/okio/pom.xml] (Duplicate zip entry [okio.jar:META-INF/maven/com.squareup.okio/okio/pom.xml])
    4>CREATEMULTIDEXMAINDEXCLASSLIST: warning : can't write resource [META-INF/maven/com.squareup.okio/okio/pom.properties] (Duplicate zip entry [okio.jar:META-INF/maven/com.squareup.okio/okio/pom.properties])
    4>      C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.9\\bin\java.exe -Djava.ext.dirs="C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\lib" com.android.multidex.MainDexListBuilder "C:\Users\white\AppData\Local\Temp\j2tf20ug.wvi.jar" "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\mono.android.jar;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\android-support-multidex.jar;obj\Debug\lp\0\jl\bin\classes.jar;obj\Debug\lp\100\jl\bin\classes.jar;obj\Debug\lp\101\jl\bin\classes.jar;obj\Debug\lp\102\jl\bin\classes.jar;obj\Debug\lp\103\jl\bin\classes.jar;obj\Debug\lp\104\jl\bin\classes.jar;obj\Debug\lp\116\jl\android.arch.core.common.jar;obj\Debug\lp\117\jl\bin\classes.jar;obj\Debug\lp\118\jl\android.arch.lifecycle.common.jar;obj\Debug\lp\119\jl\bin\classes.jar;obj\Debug\lp\120\jl\bin\classes.jar;obj\Debug\lp\121\jl\bin\classes.jar;obj\Debug\lp\122\jl\bin\classes.jar;obj\Debug\lp\125\jl\bin\classes.jar;obj\Debug\lp\126\jl\com.android.support.support-annotations.jar;obj\Debug\lp\127\jl\bin\classes.jar;obj\Debug\lp\128\jl\com.android.support.collections.jar;obj\Debug\lp\129\jl\bin\classes.jar;obj\Debug\lp\130\jl\bin\classes.jar;obj\Debug\lp\131\jl\bin\classes.jar;obj\Debug\lp\132\jl\bin\classes.jar;obj\Debug\lp\133\jl\bin\classes.jar;obj\Debug\lp\134\jl\bin\classes.jar;obj\Debug\lp\135\jl\bin\classes.jar;obj\Debug\lp\136\jl\bin\classes.jar;obj\Debug\lp\137\jl\bin\classes.jar;obj\Debug\lp\138\jl\bin\classes.jar;obj\Debug\lp\139\jl\bin\classes.jar;obj\Debug\lp\140\jl\bin\classes.jar;obj\Debug\lp\141\jl\bin\classes.jar;obj\Debug\lp\142\jl\bin\classes.jar;obj\Debug\lp\143\jl\bin\classes.jar;obj\Debug\lp\144\jl\bin\classes.jar;obj\Debug\lp\145\jl\bin\classes.jar;obj\Debug\lp\146\jl\bin\classes.jar;obj\Debug\lp\147\jl\bin\classes.jar;obj\Debug\lp\148\jl\bin\classes.jar;obj\Debug\lp\149\jl\bin\classes.jar;obj\Debug\lp\150\jl\bin\classes.jar;obj\Debug\lp\151\jl\bin\classes.jar;obj\Debug\lp\152\jl\bin\classes.jar;obj\Debug\lp\153\jl\bin\classes.jar;obj\Debug\lp\154\jl\bin\classes.jar;obj\Debug\lp\155\jl\bin\classes.jar;obj\Debug\lp\156\jl\bin\classes.jar;obj\Debug\lp\157\jl\bin\classes.jar;obj\Debug\lp\158\jl\bin\classes.jar;obj\Debug\lp\160\jl\classes.jar;obj\Debug\lp\161\jl\classes.jar;obj\Debug\lp\162\jl\classes.jar;obj\Debug\lp\163\jl\classes.jar;obj\Debug\lp\164\jl\classes.jar;obj\Debug\lp\165\jl\classes.jar;obj\Debug\lp\172\jl\classes.jar;obj\Debug\lp\173\jl\classes.jar;obj\Debug\lp\174\jl\classes.jar;obj\Debug\lp\175\jl\classes.jar;obj\Debug\lp\176\jl\classes.jar;obj\Debug\lp\177\jl\classes.jar;obj\Debug\lp\178\jl\classes.jar;obj\Debug\lp\179\jl\classes.jar;obj\Debug\lp\19\jl\formsviewgroup.jar;obj\Debug\lp\25\jl\bin\classes.jar;obj\Debug\lp\27\jl\bin\classes.jar;obj\Debug\lp\28\jl\bin\classes.jar;obj\Debug\lp\30\jl\bin\classes.jar;obj\Debug\lp\80\jl\okhttp3.jar;obj\Debug\lp\81\jl\okio.jar;obj\Debug\lp\99\jl\bin\classes.jar;obj\Debug\android\bin\classes\..\classes.zip" 
    4>      C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.9\\bin\java.exe -Xmx1G -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\\lib\dx.jar" --dex --no-strict --multi-dex --main-dex-list=obj\Debug\multidex.keep --output obj\Debug\android\bin C:\GitHub\enceladus-mobile-consumer\src\Enceladus.Mobile.Consumer.Android\obj\Debug\android\bin\classes.zip "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\mono.android.jar" "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\android-support-multidex.jar" obj\Debug\lp\0\jl\bin\classes.jar obj\Debug\lp\100\jl\bin\classes.jar obj\Debug\lp\101\jl\bin\classes.jar obj\Debug\lp\102\jl\bin\classes.jar obj\Debug\lp\103\jl\bin\classes.jar obj\Debug\lp\104\jl\bin\classes.jar obj\Debug\lp\116\jl\android.arch.core.common.jar obj\Debug\lp\117\jl\bin\classes.jar obj\Debug\lp\118\jl\android.arch.lifecycle.common.jar obj\Debug\lp\119\jl\bin\classes.jar obj\Debug\lp\120\jl\bin\classes.jar obj\Debug\lp\121\jl\bin\classes.jar obj\Debug\lp\122\jl\bin\classes.jar obj\Debug\lp\125\jl\bin\classes.jar obj\Debug\lp\126\jl\com.android.support.support-annotations.jar obj\Debug\lp\127\jl\bin\classes.jar obj\Debug\lp\128\jl\com.android.support.collections.jar obj\Debug\lp\129\jl\bin\classes.jar obj\Debug\lp\130\jl\bin\classes.jar obj\Debug\lp\131\jl\bin\classes.jar obj\Debug\lp\132\jl\bin\classes.jar obj\Debug\lp\133\jl\bin\classes.jar obj\Debug\lp\134\jl\bin\classes.jar obj\Debug\lp\135\jl\bin\classes.jar obj\Debug\lp\136\jl\bin\classes.jar obj\Debug\lp\137\jl\bin\classes.jar obj\Debug\lp\138\jl\bin\classes.jar obj\Debug\lp\139\jl\bin\classes.jar obj\Debug\lp\140\jl\bin\classes.jar obj\Debug\lp\141\jl\bin\classes.jar obj\Debug\lp\142\jl\bin\classes.jar obj\Debug\lp\143\jl\bin\classes.jar obj\Debug\lp\144\jl\bin\classes.jar obj\Debug\lp\145\jl\bin\classes.jar obj\Debug\lp\146\jl\bin\classes.jar obj\Debug\lp\147\jl\bin\classes.jar obj\Debug\lp\148\jl\bin\classes.jar obj\Debug\lp\149\jl\bin\classes.jar obj\Debug\lp\150\jl\bin\classes.jar obj\Debug\lp\151\jl\bin\classes.jar obj\Debug\lp\152\jl\bin\classes.jar obj\Debug\lp\153\jl\bin\classes.jar obj\Debug\lp\154\jl\bin\classes.jar obj\Debug\lp\155\jl\bin\classes.jar obj\Debug\lp\156\jl\bin\classes.jar obj\Debug\lp\157\jl\bin\classes.jar obj\Debug\lp\158\jl\bin\classes.jar obj\Debug\lp\160\jl\classes.jar obj\Debug\lp\161\jl\classes.jar obj\Debug\lp\162\jl\classes.jar obj\Debug\lp\163\jl\classes.jar obj\Debug\lp\164\jl\classes.jar obj\Debug\lp\165\jl\classes.jar obj\Debug\lp\172\jl\classes.jar obj\Debug\lp\173\jl\classes.jar obj\Debug\lp\174\jl\classes.jar obj\Debug\lp\175\jl\classes.jar obj\Debug\lp\176\jl\classes.jar obj\Debug\lp\177\jl\classes.jar obj\Debug\lp\178\jl\classes.jar obj\Debug\lp\179\jl\classes.jar obj\Debug\lp\19\jl\formsviewgroup.jar obj\Debug\lp\25\jl\bin\classes.jar obj\Debug\lp\27\jl\bin\classes.jar obj\Debug\lp\28\jl\bin\classes.jar obj\Debug\lp\30\jl\bin\classes.jar obj\Debug\lp\80\jl\okhttp3.jar obj\Debug\lp\81\jl\okio.jar obj\Debug\lp\99\jl\bin\classes.jar 
    4>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2610,3): error MSB6006: "java.exe" exited with code 2.
    4>Done building project "Enceladus.Mobile.Consumer.Android.fsproj" -- FAILED.
    4>
    4>Build FAILED.
    ========== Rebuild All: 3 succeeded, 1 failed, 0 skipped ==========
    
  • RobClotherRobClother GBUniversity ✭✭

    Diagnostics logs attached

  • YorkGoYorkGo CNMember, Xamarin Team Xamurai

    What is the version of VS? If your VS is not the latest version, please update to the latest version and try again.

  • YorkGoYorkGo CNMember, Xamarin Team Xamurai
    edited December 2018

    What is your project compile version?

    And what is your device android OS version?

  • RobClotherRobClother GBUniversity ✭✭

    Android 9.0 (Pie)

  • RobClotherRobClother GBUniversity ✭✭

    There is a repro online at https://github.com/SpiegelSoft/Repro

    This is to do with using an Android class library.

  • RobClotherRobClother GBUniversity ✭✭

    The build also fails after upgrading to the 28.0.3 build tools from the Google repository.

  • YorkGoYorkGo CNMember, Xamarin Team Xamurai

    Would you mind sharing a basic demo so that we could reproduce this issue on our side?

  • YorkGoYorkGo CNMember, Xamarin Team Xamurai

    @RobClother , Sorry for the delay getting back to you. When you post a reply you could give me a reminder by add @YorkGo , so that I will see it immediately when I am online.

    Is there any updates regarding this issue? I build your project on my side but can't reproduce this issue, I could build your project without any issue, build effect on my side.

  • AntonioStan.2954AntonioStan.2954 USMember ✭✭

    @RobClother I encountered almost the same issue as you did so I started investigating the packages. The only package that had something like "okio" was Square.OkIO, but Square.OkHttp3 relies on it and modernhttpclient-updated installs both. So I removed those three packages and installed modernhttpclient (the simple and old one).

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    I have the same error but I don't know what's causing it.

    It just happend and I am unable to figure out where is the issue.

    Here is the Output log:

    https://www.softnames.com/temp/Error.txt

    Multi-Dex is already Enabled

    1.png 18.4K
    3.png 17.5K
  • JassimRahmaJassimRahma USMember ✭✭✭✭

    I have added below and it seems to be working fine so far.

    Thank you

    <PropertyGroup>
      <DxExtraArguments>--dex --no-strict --force-jumbo</DxExtraArguments>
      <AndroidMultiDexClassListExtraArgs>--disable-annotation-resolution-workaround</AndroidMultiDexClassListExtraArgs>
    </PropertyGroup>
    
  • Sw1maSw1ma USMember ✭✭
    edited June 2019

    When using AndroidMultiDexClassListExtraArgs as mentioned in tutorial article "Build process", the application project would not build in Azure DevOps or/and App Center.

    Related issue that solved this issue for me: Xamarin.Android application "COMPILETODALVIK : error : no command specified" when using AndroidMultiDexClassListExtraArgs #2585

    In your Android.csproj file add the following after opt in "Multi-Dex" via Properties:

    <AndroidEnableMultiDex>true</AndroidEnableMultiDex>
    <DxExtraArguments>--dex --no-strict --force-jumbo</DxExtraArguments>
    <AndroidMultiDexClassListExtraArgs>--disable-annotation-resolution-workaround</AndroidMultiDexClassListExtraArgs>
    
Sign In or Register to comment.