错误消息1:
CommandInvokationFailure:Gradle构建失败。 C:/ Program Files / Java / jdk1.8.0_181 \ bin \ java.exe -classpath“ C:\ Program Files \ Unity \ Hub \ Editor \ 2019.1.0a10 \ Editor \ Data \ PlaybackEngines \ AndroidPlayer \ Tools \ gradle \ lib \ gradle-launcher-4.6.jar” org.gradle.launcher.GradleMain“ -Dorg.gradle.jvmargs = -Xmx4096m”“ assembleRelease”
错误消息2:
构建完成,结果为'Failed'UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
错误消息3:
BuildPlayerOptions选项)[0x00234]在C:\ buildslave \ unity \ build \ Editor \ Mono \ BuildPlayerWindowBuildMethods.cs:190在UnityEditor.BuildPlayerWindow.CallBuildMethods(System.Boolean askForBuildLocation,UnityEditor.BuildOptions defaultBuildOptions)在C中[0x0007f] :\ buildslave \ unity \ build \ Editor \ Mono \ BuildPlayerWindowBuildMethods.cs:96 UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
控制台编辑器内部错误:
stderr [ D8:程序类型已经存在:com.unity3d.ads.BuildConfig
失败:构建失败,并出现异常。
尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获取完整的见解。
在2m 38s内失败
]
标准输出[
:checkReleaseClasspath
:preBuild截止日期
:preReleaseBuild
:compileReleaseAidl没有资源
:compileReleaseRenderscript
:checkReleaseManifest
:generateReleaseBuildConfig
:prepareLintJar
:mainApkListPersistenceRelease
:generateReleaseResValues
:generateReleaseResources
:mergeReleaseResources
:createReleaseCompatibleScreenManifests
:processReleaseManifest
:splitsDiscoveryTaskRelease
:processReleaseResources
:generateReleaseSources
:javaPreCompileRelease
:compileReleaseJavaWithJavac
:compileReleaseNdk NO-SOURCE
:compileReleaseSources
:lintVitalRelease
:mergeReleaseShaders
:compileReleaseShaders
:generateReleaseAssets
:mergeReleaseAssets
:transformClassesWithDexBuilderForRelease
:transformDexArchiveWithExternalLibsDexMergerForRelease失败
21个可执行任务:21个已执行
]
退出代码:1
在<4c5a816e27224218a2785a0505447762>:0中的UnityEditor.Android.Command.WaitForProgramToRun(UnityEditor.Utils.Program p,UnityEditor.Android.Command + WaitingForProcessToExit waitingProcess.Exit,System.String errorMsg)[0x00031]中
在<4c5a816e27224218a2785a0505447762>:0中的UnityEditor.Android.Command.Run(System.Diagnostics.ProcessStartInfo psi,UnityEditor.Android.Command + WaitingForProcessToExitwaitingForProcessToExit,System.String errorMsg)[0x00015]
在<4c5a816e27224218a2785a0505447762>:0中的UnityEditor.Android.Command.Run(System.String命令,System.String args,System.String工作目录,UnityEditor.Android.Command + WaitingForProcessToExitwaitingForProcessToExit,System.String errorMsg)中的[0x0000a]
在<4c5a816e27224218a2785a0505447762>:0中的UnityEditor.Android.AndroidJavaTools.RunJava(System.String args,System.String workingdir,System.Action 1[T] progress, System.String error) [0x0001f] in <4c5a816e27224218a2785a0505447762>:0
at UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action
1 [T] progress)[0x00021]中
作为GradleInvokationException重新抛出:Gradle构建失败
在<4c5a816e27224218a2785a0505447762>:0中的UnityEditor.Android.GradleWrapper.Run(UnityEditor.Android.Android.AndroidJavaTools javaTools,System.String workingdir,System.String task,System.Action`1 [T] progress)[0x00042]
在<4c5a816e27224218a2785a0505447762>:0中的UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute(UnityEditor.Android.PostProcessor.PostProcessorContext上下文)[0x000a8]中
在<4c5a816e27224218a2785a0505447762>:0中的UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks(UnityEditor.Android.PostProcessor.PostProcessorContext上下文)[0x00074]中
UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck()
UnityEditor.DefaultBuildMethods:BuildPlayer(BuildPlayerOptions)(位于C:\ buildslave \ unity \ build \ Editor \ Mono \ BuildPlayerWindowBuildMethods.cs:172)
UnityEditor.BuildPlayerWindow:CallBuildMethods(布尔值,BuildOptions)(在C:\ buildslave \ unity \ build \ Editor \ Mono \ BuildPlayerWindowBuildMethods.cs:96)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun(布尔值)(在C:\ buildslave \ unity \ build \ Editor \ Mono \ BuildPlayerWindow.cs:130)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()(在C:\ buildslave \ unity \ build \ Editor \ Mono \ BuildPlayerWindow.cs:124)
答案 0 :(得分:0)
为了解决此问题,我必须按此顺序执行以下步骤:
注意-我正在使用Unity 2019.1.0.a10(我不建议其他人使用,因为现在可以使用更安全的升级版本)。