Hello I m trying to build my ARCore HelloAR and i m getting build error CommandInvokationFailure: Gradle build failed. C:/Program Files/Java/jdk1.8.0_161\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease" Execution failed for task ':transformClassesWithDexForRelease'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/aidl/BaseProxy; I 've done a bit of research but i didnt really get any solution.I ve downgraded sdk to v24 and my JDK is v8
Do you also have Daydream GVR or Cardboard packages in your project. I saw the same error also with GVR. This is because there is a Java package (com.google.android.aidl.BaseProxy) that is in both ARCore and another package you are using. I had the same issue with ARCore and GVR. You need to remove the package from one of the aar files. I chose arcore_client.aar from ARCore. And then (there must be an easier way to do this) : rename arcore_client.aar to arcore_client.zip look at arcore_client.zip in Windows explorer and find the classes.jar file inside. Copy classes.jar out of the zip Rename classes.jar to classes.zip Look inside classes.zip in Windows explorer for the above package and delete the .class files (I had 3 of them) Rename classes.zip to classes.jar Copy back into arclient_core.zip Rename arclient_core.zip to arclient_core.aar Copy back to the ARCore asset folder where you found it. That should give you a working build
You were completely right ! Thank you so much.I didnt notice i was using Cardboard packages.I had them enabled in my Player VR build Settings and i disabled them cause for the time being i dont need it.But in future builds of my project there is a high possibility that i use cardboard support so i ll know how to solve it