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
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.
Diagnostic output:
Diagnostics logs attached
What is the version of VS? If your VS is not the latest version, please update to the latest version and try again.
What is your project compile version?
And what is your device android OS version?
Android 9.0 (Pie)
There is a repro online at https://github.com/SpiegelSoft/Repro
This is to do with using an Android class library.
The build also fails after upgrading to the 28.0.3 build tools from the Google repository.
Would you mind sharing a basic demo so that we could reproduce this issue on our side?
https://github.com/SpiegelSoft/Repro
@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.
@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).
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
I have added below and it seems to be working fine so far.
Thank you
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: