-2

While building my project when it reach Task mergeReleaseAssets i get this error com.android.build.api.transform.TransformException:

com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/content/res/TypedArryUtils; See the Console for details

----i don't know what cause this my jdk8u-131 i tried 8u161 and i don't know about SDK maybe its api level cuz my phone api level 27 Oreo and its not on unity and i did't Download Android 8.0 (Oreo) on SDK and i'm not using In-App PURCHASING just normal ads from unity

and for GoggleMobileAds i download it but i did't use it on project cuz it hurt my head and i used normal ads from unity

this is the error on console

CommandInvokationFailure: Gradle build failed.

C:/Program Files/Java/jdk1.8.0_131\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" stderr[ FAILURE: Build failed with an exception. What went wrong:

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 Landroid/support/v4/content/res/TypedArrayUtils;
:transformClassesWithDexForRelease FAILED 66 actionable tasks: 56 executed, 10 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.Action1 progress, System.String error) UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action1 progress) Rethrow as GradleInvokationException: Gradle build failed UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action1 progress) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

Anuraag Baishya
  • 866
  • 2
  • 11
  • 26

1 Answers1

0

Add multiDexEnabled true in your defaultConfig in the app level gradle.

defaultConfig {
    applicationId "your application id"
    minSdkVersion 16
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}
  • where do find this thing could you be more specific cuz i'm to new for this and so is my application id where can i find it Thank you i know its stupid question – Miller-M4 Apr 11 '18 at 06:06
  • application id is your package name like "com.something.something" ;P com.whatsapp is whatsapp id , com.facebook.katana is facebook app id – Vinay Sasalatti Apr 11 '18 at 07:28
  • Any help please and when i try to build on different project everything working just on this project i get this problem – Miller-M4 Apr 14 '18 at 12:50