android - Unity3d Android构建错误
问题描述
我收到以下错误。问题出在哪里?
Java jdk 10.0.1 。我已经查看了所有类似的问题,但根本没有答案。
CommandInvokationFailure: Gradle build failed.
C:/Program Files/Java/jdk-10.0.1\bin\java.exe -classpath "C:\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.
* What went wrong:
Could not determine java version from '10.0.1'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
]
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在jdk 10上存在一些问题,很多拥有jdk 10的人都有这个问题,但可以通过安装jdk 8来解决。我已经尝试过了,也为我工作。
推荐阅读
- api - 生成access_token并成功重定向到onelogin idp(OIDC)中的redirect_uri后如何注销
- php - 如何在 laravel 数据库中检查其他站点导入用户的密码
- javascript - Drupal 8 的 Jquery .once() 问题
- reactjs - 使用 react-testing-library 测试卸载
- javascript - 两个具有不同 css 功能的导航栏导致滚动时导航栏颜色变化不起作用
- python - set(l) 的大 O 复杂度,其中 l 是一个列表
- python - Keras 层的输入
- ffmpeg - 如何使用 ffmpeg 将 CEA-608/708 嵌入到视频中
- c# - Workfront RESTAPI 查询时区
- angular - 如何在 Angular 8 应用程序中使用 SAML 身份验证?