我想使用IntelliJ IDEA 15而不是Android Studio,但我在构建时遇到问题.我收到以下错误:
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 15.0\jre,daemonRegistryDir=C:\Users\Tim\.gradle\daemon,pid=1224,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252,-Duser.country=DE,-Duser.language=de,-Duser.variant]
Actual: DefaultDaemonContext[uid=6fd89265-5686-4337-a75f-538209464d3a,javaHome=C:\Program Files\Java\jdk1.8.0_74,daemonRegistryDir=C:\Users\Tim\.gradle\daemon,pid=14128,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252,-Duser.country=DE,-Duser.language=de,-Duser.variant]
Run Code Online (Sandbox Code Playgroud)
我的错是什么?正如您在下面的图片中看到的,一切都配置正确.
我已经配置了JDK和Android Tools,如下所示:
使用某些第三方库时,我会在模块的build.gradle文件中添加依赖项.
compile 'com.android.support:appcompat-v7:24.1.1'
Run Code Online (Sandbox Code Playgroud)
或者我添加一个插件
apply plugin: 'com.neenbedankt.android-apt'
Run Code Online (Sandbox Code Playgroud)
其他一些时候,库需要为我的应用程序的build.gradle文件添加依赖项.
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
Run Code Online (Sandbox Code Playgroud)
这些依赖项和插件有什么区别?
为什么不能将它们全部设置在一个build.gradle文件中?
所有的建议都很感激,我在搜索这方面的信息时遇到了麻烦