我一直试图让libGDX解决问题,但在gradle建设时我总是遇到错误。
这是错误
Gradle sync failed: The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch:
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.3.2\jre,daemonRegistryDir=C:\Users\Shawn\.gradle\daemon,pid=396,idleTimeout=null,daemonOpts=-Xms128m,-Xmx1500m,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]
Actual: DefaultDaemonContext[uid=be8febdd-0d00-4ec8-98ce-6076e4f5a2eb,javaHome=C:\Program Files\Java\jdk1.8.0_111,daemonRegistryDir=C:\Users\Shawn\.gradle\daemon,pid=9116,idleTimeout=60000,daemonOpts=-Xms128m,-Xmx1500m,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]
Consult IDE log for more details (Help | Show Log)
我的项目结构 Structure
build.gradle文件
解决:
我通过在gradle.properties文件中添加一行来修复它
org.gradle.java.home=C:/Program Files/Java/jdk1.8.0_111
答案 0 :(得分:0)
更改您的构建工具
转到选项(ctrl + alt + s)并选择图片中的标签,然后将JRE更改为实际的jdk1.8.0_111
(如果您选择的很少,请尝试选择它们并运行您的应用):< / p>
如果它不工作,我们会更进一步:D
Android Studio