本文介紹了Android Studio - Gradle 同步項目失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
在 Android Studio 中,我只是創建了一個新項目,它說:
In Android Studio, I simply created a new project, and it says that:
Gradle 項目同步失敗.基本功能將無法正常工作.
我已經在網上搜索并嘗試了所有方法,但沒有任何效果.我有使用 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.
錯誤信息是:
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 控制臺"選項卡中閱讀正確的錯誤消息.
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
這篇關于Android Studio - Gradle 同步項目失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!