简体   繁体   English

Gradle无法在Android Studio(v1.1.0)中同步

[英]Gradle not syncing in Android studio (v1.1.0)

When I attempt to sync, I get the following error: 尝试同步时,出现以下错误:

The supplied javaHome seems to be invalid. 提供的javaHome似乎无效。 I cannot find the java executable. 我找不到Java可执行文件。 >Tried location: C:\\Program Files\\Java\\jdk1.8.0_45\\bin\\java.exe >尝试位置:C:\\ Program Files \\ Java \\ jdk1.8.0_45 \\ bin \\ java.exe

Maybe i need to use jdk 1.7, but I cant seem to change it, please help (I have jdk 1.7) 也许我需要使用jdk 1.7,但是我似乎无法更改它,请帮助(我有jdk 1.7)

For fixing the problem inside IntelliJ Idea do the following : 要解决IntelliJ Idea中的问题,请执行以下操作:

File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JVM -> Change to your appropriate JVM 文件->设置->构建,执行,部署->构建工具-> Gradle-> Gradle JVM->更改为适当的JVM

Check File , Project Structure , here you can change the JDK: 检查FileProject Structure ,在这里您可以更改JDK:

在此处输入图片说明

Here you can select the source and target compatibility as well: 在这里,您还可以选择源和目标兼容性:

在此处输入图片说明

This information refers to Android Studio. 此信息是指Android Studio。

In Intellij (or Android Studio) you have to download Gradle file from the Gradle website and then go to Intellij settings choose the manual configuration, then point the Gradle address you have downloaded. 在Intellij(或Android Studio)中,您必须从Gradle网站下载Gradle文件,然后转到Intellij设置,选择手动配置,然后指向您已下载的Gradle地址。

In the same issue I resolved this error like this. 在同一问题中,我这样解决了此错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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