当前位置:   article > 正文

Unity打包遇到CommandInvokationFailure: Gradle build failed.

commandinvokationfailure: gradle build failed.

环境:

Untiy2017.3.1

jdk:7.0


报错:

CommandInvokationFailure: Gradle build failed. 
C:/Program Files/Java/jdk1.7.0_80\bin\java.exe -classpath "D:\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.


* Where:
Build file 'F:\PeppaPig\trunk\Client\Temp\gradleOut\build.gradle' line: 20


* What went wrong:
A problem occurred evaluating root project 'gradleOut'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


BUILD FAILED in 1s
]
stdout[


]
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 (System.String workingdir, System.String task, System.Action`1 progress)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (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)


解决方案:

Unity编辑器 File->Build Setting->Android->Build System选择Internal

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小惠珠哦/article/detail/965323
推荐阅读
相关标签
  

闽ICP备14008679号