unity打Android包报错

十二点不睡觉 2019-06-25 11:04:19
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)
...全文
437 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
糟糕点师 2019-06-26
  • 打赏
  • 举报
回复
把原来的SDK删掉,我给你个版本更高的吧,我用的是2.4好像
qq_41619328 2019-06-25
  • 打赏
  • 举报
回复
android sdk 有重复的包吧

2,535

社区成员

发帖
与我相关
我的任务
社区描述
Unity3D相关内容讨论专区
游戏unity 技术论坛(原bbs)
社区管理员
  • Unity3D
  • 芝麻粒儿
  • 「已注销」
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

Unity3D社区公告:

  1. 社区致力于解决各种Unity3D相关的“疑难杂症”。
  2. 社区不允许发布与Unity3D或相关技术无关内容。
  3. 社区版主邀请各位一道为打造优秀社区不懈努力。

试试用AI创作助手写篇文章吧