Android平台-Gradle构建失败-错误是什么意思

时间:2019-03-17 21:17:36

标签: android unity3d

错误消息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运行以获取完整的见解。

  • https://help.gradle.org

  • 获得更多帮助

在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.RunAllTask​​s(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)

1 个答案:

答案 0 :(得分:0)

为了解决此问题,我必须按此顺序执行以下步骤:

  1. 在项目中删除Unity Ads插件
  2. 保存项目并关闭Unity
  3. 打开Unity,我正在从事的项目
  4. 在“服务”标签中,关闭Unity Ads
  5. 重新导入货币化3.0.1插件
  6. 在“服务”标签中,打开Unity Ads
  7. 确保未选中“启用内置广告”

注意-我正在使用Unity 2019.1.0.a10(我不建议其他人使用,因为现在可以使用更安全的升级版本)。