unity打Android包报错
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Java\jdk1.8.0_40\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2018.2.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.2.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleDebug"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
* 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 16s
]
stdout[
Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details
:preBuild UP-TO-DATE
:Firebase:preBuild UP-TO-DATE
:Firebase:preDebugBuild UP-TO-DATE
:Firebase:checkDebugManifest
:Firebase:processDebugManifest
:GoogleMobileAdsPlugin:preBuild UP-TO-DATE
:GoogleMobileAdsPlugin:preDebugBuild UP-TO-DATE
:GoogleMobileAdsPlugin:checkDebugManifest
:GoogleMobileAdsPlugin:processDebugManifest
:GooglePlayGamesManifest.plugin:preBuild UP-TO-DATE
:GooglePlayGamesManifest.plugin:preDebugBuild UP-TO-DATE
:GooglePlayGamesManifest.plugin:checkDebugManifest
:GooglePlayGamesManifest.plugin:processDebugManifest
:preDebugBuild
:Firebase:compileDebugAidl
:GoogleMobileAdsPlugin:compileDebugAidl
:GooglePlayGamesManifest.plugin:compileDebugAidl
:compileDebugAidl
:Firebase:packageDebugRenderscript NO-SOURCE
:GoogleMobileAdsPlugin:packageDebugRenderscript NO-SOURCE
:GooglePlayGamesManifest.plugin:packageDebugRenderscript NO-SOURCE
:compileDebugRenderscript
:checkDebugManifest
:generateDebugBuildConfig
:prepareLintJar
:generateDebugResValues
:generateDebugResources
:Firebase:compileDebugRenderscript
:Firebase:generateDebugResValues
:Firebase:generateDebugResources
:Firebase:packageDebugResources
:GoogleMobileAdsPlugin:compileDebugRenderscript
:GoogleMobileAdsPlugin:generateDebugResValues
:GoogleMobileAdsPlugin:generateDebugResources
:GoogleMobileAdsPlugin:packageDebugResources
:GooglePlayGamesManifest.plugin:compileDebugRenderscript
:GooglePlayGamesManifest.plugin:generateDebugResValues
:GooglePlayGamesManifest.plugin:generateDebugResources
:GooglePlayGamesManifest.plugin:packageDebugResources
:mergeDebugResources
:createDebugCompatibleScreenManifests
:processDebugManifest
:splitsDiscoveryTaskDebug
:Firebase:platformAttrExtractor
:GoogleMobileAdsPlugin:platformAttrExtractor
:GooglePlayGamesManifest.plugin:platformAttrExtractor
:Firebase:generateDebugBuildConfig
:Firebase:prepareLintJar
:Firebase:javaPreCompileDebug
:Firebase:processDebugJavaRes NO-SOURCE
:GoogleMobileAdsPlugin:generateDebugBuildConfig
:GoogleMobileAdsPlugin:prepareLintJar
:GoogleMobileAdsPlugin:javaPreCompileDebug
:GoogleMobileAdsPlugin:processDebugJavaRes NO-SOURCE
:GooglePlayGamesManifest.plugin:generateDebugBuildConfig
:GooglePlayGamesManifest.plugin:prepareLintJar
:GooglePlayGamesManifest.plugin:javaPreCompileDebug
:GooglePlayGamesManifest.plugin:processDebugJavaRes NO-SOURCE
:compileDebugNdk NO-SOURCE
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:Firebase:mergeDebugShaders
:Firebase:compileDebugShaders
:Firebase:generateDebugAssets
:Firebase:mergeDebugAssets
:GoogleMobileAdsPlugin:mergeDebugShaders
:GoogleMobileAdsPlugin:compileDebugShaders
:GoogleMobileAdsPlugin:generateDebugAssets
:GoogleMobileAdsPlugin:mergeDebugAssets
:GooglePlayGamesManifest.plugin:mergeDebugShaders
:GooglePlayGamesManifest.plugin:compileDebugShaders
:GooglePlayGamesManifest.plugin:generateDebugAssets
:GooglePlayGamesManifest.plugin:mergeDebugAssets
:mergeDebugAssets
:mergeDebugJniLibFolders
:Firebase:compileDebugNdk NO-SOURCE
:Firebase:mergeDebugJniLibFolders
:Firebase:transformNativeLibsWithMergeJniLibsForDebug
:Firebase:transformNativeLibsWithStripDebugSymbolForDebug
:Firebase:transformNativeLibsWithIntermediateJniLibsForDebug
:GoogleMobileAdsPlugin:compileDebugNdk NO-SOURCE
:GoogleMobileAdsPlugin:mergeDebugJniLibFolders
:GoogleMobileAdsPlugin:transformNativeLibsWithMergeJniLibsForDebug
:GoogleMobileAdsPlugin:transformNativeLibsWithStripDebugSymbolForDebug
:GoogleMobileAdsPlugin:transformNativeLibsWithIntermediateJniLibsForDebug
:GooglePlayGamesManifest.plugin:compileDebugNdk NO-SOURCE
:GooglePlayGamesManifest.plugin:mergeDebugJniLibFolders
:GooglePlayGamesManifest.plugin:transformNativeLibsWithMergeJniLibsForDebug
:GooglePlayGamesManifest.plugin:transformNativeLibsWithStripDebugSymbolForDebug
:GooglePlayGamesManifest.plugin:transformNativeLibsWithIntermediateJniLibsForDebug
:processDebugJavaRes NO-SOURCE
:validateSigningDebug
:Firebase:mergeDebugConsumerProguardFiles
:Firebase:transformNativeLibsWithSyncJniLibsForDebug
:GoogleMobileAdsPlugin:mergeDebugConsumerProguardFiles
:GoogleMobileAdsPlugin:transformNativeLibsWithSyncJniLibsForDebug
:GooglePlayGamesManifest.plugin:mergeDebugConsumerProguardFiles
:GooglePlayGamesManifest.plugin:transformNativeLibsWithSyncJniLibsForDebug
:GooglePlayGamesManifest.plugin:processDebugResources
:GooglePlayGamesManifest.plugin:generateDebugSources
:GooglePlayGamesManifest.plugin:compileDebugJavaWithJavac
:GooglePlayGamesManifest.plugin:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
:GooglePlayGamesManifest.plugin:extractDebugAnnotations
:GooglePlayGamesManifest.plugin:transformResourcesWithMergeJavaResForDebug
:GooglePlayGamesManifest.plugin:transformClassesAndResourcesWithSyncLibJarsForDebug
:GooglePlayGamesManifest.plugin:bundleDebug
:GooglePlayGamesManifest.plugin:compileDebugSources
:GooglePlayGamesManifest.plugin:assembleDebug
:GoogleMobileAdsPlugin:processDebugResources
:GoogleMobileAdsPlugin:generateDebugSources
:GoogleMobileAdsPlugin:compileDebugJavaWithJavac
:GoogleMobileAdsPlugin:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
:GoogleMobileAdsPlugin:extractDebugAnnotations
:GoogleMobileAdsPlugin:transformResourcesWithMergeJavaResForDebug
:GoogleMobileAdsPlugin:transformClassesAndResourcesWithSyncLibJarsForDebug
:GoogleMobileAdsPlugin:bundleDebug
:GoogleMobileAdsPlugin:compileDebugSources
:GoogleMobileAdsPlugin:assembleDebug
:Firebase:processDebugResources
:processDebugResources
:generateDebugSources
:Firebase:generateDebugSources
:Firebase:compileDebugJavaWithJavac
:Firebase:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
:javaPreCompileDebug
:compileDebugJavaWithJavac
:compileDebugSources
:transformClassesWithDexBuilderForDebug
:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
95 actionable tasks: 95 executed
]
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)