简体   繁体   中英

Gradle not building

The following error occurs and none of my android projects sync with gradle. This occurred spontaneously when I opened android studio. My JAVA_HOME user variable is set to 'C:\\Program Files\\Java\\jdk1.8.0_144\\bin'. Also, JDK location in android studio wont change from F:\\Softwares\\Android\\jre to anything because it changes back when I try to change it.

The newly created daemon process has a different context than expected. 
Java home is differnt.
Expecting: 'F:\Softwares\Android\jre' but was: 'C:\Program
Files\JAVA\jdk1.8.0_144'. Please configure the JDK to match the expected one.

I changed the sdk and ndk location to somewhere else, so that the warnings for space in paths donot occur. Then I could change the JDK location inside android studio to 'C:\\ProgramFiles\\JAVA\\jdk1.8.0_144'. This fixed the gradle problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM