問(wèn)題描述
在 Android Studio 中,我只是創(chuàng)建了一個(gè)新項(xiàng)目,它說(shuō):
In Android Studio, I simply created a new project, and it says that:
Gradle 項(xiàng)目同步失敗.基本功能將無(wú)法正常工作.
我已經(jīng)在網(wǎng)上搜索并嘗試了所有方法,但沒(méi)有任何效果.我有使用 Gradle 1.11 的 Android Studio v0.4.6.
I have searched the web and tried everything, but nothing worked. I have v0.4.6 of Android Studio using Gradle 1.11.
錯(cuò)誤信息是:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:UsersVinnieAndroidStudioProjectsMyFirstAppProjectMyFirstAppuild.gradle' line: 9
* What went wrong:
A problem occurred evaluating project ':MyFirstApp'.
> Gradle version 1.10 is required. Current version is 1.11. If using the gradle wrapper, try editing the distributionUrl in C:UsersVinnieAndroidStudioProjectsMyFirstAppProjectMyFirstAppgradlewrappergradle-wrapper.properties to gradle-1.10-all.zip
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 7.011 secs
推薦答案
Android插件0.8.x不支持Gradle 1.11,需要使用1.10.
The Android plugin 0.8.x doesn't support Gradle 1.11, you need to use 1.10.
您可以在Gradle 控制臺(tái)"選項(xiàng)卡中閱讀正確的錯(cuò)誤消息.
You can read the proper error message in the "Gradle Console" tab.
編輯
你需要這樣修改gradle/wrapper/gradle-wrapper.properties
文件:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http://services.gradle.org/distributions/gradle-1.10-all.zip
這篇關(guān)于Android Studio - Gradle 同步項(xiàng)目失敗的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!