- Home /
Possible conflict between plugin, error on build
Hi guys so I keep getting the same error that is stoping me from building the project successfully on Android, as plugins I use GoogleAdMob and GooglePlayServices, I will put some screenshots because i have no ideea how to explain the situation, it would be great if someone from here could help me , also here is the full text from the console:
"CommandInvokationFailure: Gradle build failed. C:/Program Files/Java/jdk1.8.0_181\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.2.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease" stderr[ FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':transformDexWithDexForRelease'. > 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/unity3d/ads/BuildConfig; Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. * Get more help at https://help.gradle.org BUILD FAILED in 11s ] stdout[ :preBuild UP-TO-DATE :GoogleMobileAdsPlugin:preBuild UP-TO-DATE :GoogleMobileAdsPlugin:preReleaseBuild UP-TO-DATE :GoogleMobileAdsPlugin:checkReleaseManifest :GoogleMobileAdsPlugin:processReleaseManifest :GooglePlayGamesManifest.plugin:preBuild UP-TO-DATE :GooglePlayGamesManifest.plugin:preReleaseBuild UP-TO-DATE :GooglePlayGamesManifest.plugin:checkReleaseManifest :GooglePlayGamesManifest.plugin:processReleaseManifest :preReleaseBuild UP-TO-DATE :GoogleMobileAdsPlugin:compileReleaseAidl :GooglePlayGamesManifest.plugin:compileReleaseAidl :compileReleaseAidl UP-TO-DATE :GoogleMobileAdsPlugin:packageReleaseRenderscript NO-SOURCE :GooglePlayGamesManifest.plugin:packageReleaseRenderscript NO-SOURCE :compileReleaseRenderscript UP-TO-DATE :checkReleaseManifest UP-TO-DATE :generateReleaseBuildConfig UP-TO-DATE :prepareLintJar UP-TO-DATE :generateReleaseResValues UP-TO-DATE :generateReleaseResources UP-TO-DATE :GoogleMobileAdsPlugin:compileReleaseRenderscript :GoogleMobileAdsPlugin:generateReleaseResValues :GoogleMobileAdsPlugin:generateReleaseResources :GoogleMobileAdsPlugin:packageReleaseResources :GooglePlayGamesManifest.plugin:compileReleaseRenderscript :GooglePlayGamesManifest.plugin:generateReleaseResValues :GooglePlayGamesManifest.plugin:generateReleaseResources :GooglePlayGamesManifest.plugin:packageReleaseResources :mergeReleaseResources UP-TO-DATE :createReleaseCompatibleScreenManifests UP-TO-DATE :processReleaseManifest :splitsDiscoveryTaskRelease UP-TO-DATE :GoogleMobileAdsPlugin:platformAttrExtractor :GooglePlayGamesManifest.plugin:platformAttrExtractor :GoogleMobileAdsPlugin:generateReleaseBuildConfig :GoogleMobileAdsPlugin:processReleaseResources :GoogleMobileAdsPlugin:prepareLintJar UP-TO-DATE :GoogleMobileAdsPlugin:generateReleaseSources :GoogleMobileAdsPlugin:javaPreCompileRelease :GoogleMobileAdsPlugin:compileReleaseJavaWithJavac :GoogleMobileAdsPlugin:processReleaseJavaRes NO-SOURCE :GoogleMobileAdsPlugin:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease :GooglePlayGamesManifest.plugin:generateReleaseBuildConfig :GooglePlayGamesManifest.plugin:prepareLintJar UP-TO-DATE :GooglePlayGamesManifest.plugin:javaPreCompileRelease :GooglePlayGamesManifest.plugin:processReleaseJavaRes NO-SOURCE :compileReleaseNdk NO-SOURCE :mergeReleaseShaders UP-TO-DATE :compileReleaseShaders UP-TO-DATE :generateReleaseAssets UP-TO-DATE :GoogleMobileAdsPlugin:mergeReleaseShaders :GoogleMobileAdsPlugin:compileReleaseShaders :GoogleMobileAdsPlugin:generateReleaseAssets :GoogleMobileAdsPlugin:mergeReleaseAssets :GooglePlayGamesManifest.plugin:mergeReleaseShaders :GooglePlayGamesManifest.plugin:compileReleaseShaders :GooglePlayGamesManifest.plugin:generateReleaseAssets :GooglePlayGamesManifest.plugin:mergeReleaseAssets :mergeReleaseAssets :mergeReleaseJniLibFolders UP-TO-DATE :GoogleMobileAdsPlugin:compileReleaseNdk NO-SOURCE :GoogleMobileAdsPlugin:mergeReleaseJniLibFolders :GoogleMobileAdsPlugin:transformNativeLibsWithMergeJniLibsForRelease :GoogleMobileAdsPlugin:transformNativeLibsWithStripDebugSymbolForRelease :GoogleMobileAdsPlugin:transformNativeLibsWithIntermediateJniLibsForRelease :GooglePlayGamesManifest.plugin:compileReleaseNdk NO-SOURCE :GooglePlayGamesManifest.plugin:mergeReleaseJniLibFolders :GooglePlayGamesManifest.plugin:transformNativeLibsWithMergeJniLibsForRelease :GooglePlayGamesManifest.plugin:transformNativeLibsWithStripDebugSymbolForRelease :GooglePlayGamesManifest.plugin:transformNativeLibsWithIntermediateJniLibsForRelease :processReleaseJavaRes NO-SOURCE :validateSigningRelease :GoogleMobileAdsPlugin:extractReleaseAnnotations :GoogleMobileAdsPlugin:mergeReleaseConsumerProguardFiles UP-TO-DATE :GoogleMobileAdsPlugin:transformResourcesWithMergeJavaResForRelease :GoogleMobileAdsPlugin:transformClassesAndResourcesWithSyncLibJarsForRelease :GoogleMobileAdsPlugin:transformNativeLibsWithSyncJniLibsForRelease :GoogleMobileAdsPlugin:bundleRelease :GoogleMobileAdsPlugin:compileReleaseSources :GoogleMobileAdsPlugin:mergeReleaseResources :GoogleMobileAdsPlugin:verifyReleaseResources :GoogleMobileAdsPlugin:assembleRelease :GooglePlayGamesManifest.plugin:mergeReleaseConsumerProguardFiles UP-TO-DATE :GooglePlayGamesManifest.plugin:transformNativeLibsWithSyncJniLibsForRelease :GooglePlayGamesManifest.plugin:mergeReleaseResources :GooglePlayGamesManifest.plugin:verifyReleaseResources :GooglePlayGamesManifest.plugin:processReleaseResources :processReleaseResources :generateReleaseSources :GooglePlayGamesManifest.plugin:generateReleaseSources :GooglePlayGamesManifest.plugin:compileReleaseJavaWithJavac :GooglePlayGamesManifest.plugin:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease :javaPreCompileRelease UP-TO-DATE :compileReleaseJavaWithJavac UP-TO-DATE :compileReleaseSources UP-TO-DATE :lintVitalRelease :transformClassesWithPreDexForRelease UP-TO-DATE :transformDexWithDexForRelease FAILED 74 actionable tasks: 54 executed, 20 up-to-date ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1 progress) Rethrow as GradleInvokationException: Gradle build failed UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1 progress) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)"
[1]: /storage/temp/124048-2.jpg
Did you check the following questions?
Error when building for Android after importing an asset from the store.
try to search in unity "Android$$anonymous$$anifest" and tell me if it got 2 androidmanifest if it has two try to move one of them to your desktop and try to build it.
$$anonymous$$ultiple dex files define /BuildConfig
In my case the similar error happened because there were 2 modules with the same package name in Android$$anonymous$$anifest.xml files. Using different package names in the modules solved the problem.
Also the same thing happens when a library jar is being included twice (or more times) in several modules, as a dependency. In this case error message says about duplicate configs named after that library's package name. I solved it with including the library as a dependency in one module, and the second module had in dependencies the first module.
Gradle Build Error
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
Yeah looks like i have to Android$$anonymous$$anifest.xml in my unity project , one from Google$$anonymous$$obileAdsPlugin(Admob Plugin) and one from GooglePlayGames , i moved one out but the same problem has occured.
Answer by unity_ZMauUlOHpsaBjA · Sep 13, 2018 at 02:22 PM
I fixed it by deleting all the plugin and reinstalling them back.