Android Studio下,gradle project sync failed 錯誤

Android studio下突然報錯

gradle project sync failed.Basic functionality(e.g.editing,debugging) will not work properly.

解決方案:進入項目目錄下,找到 gradle\wrapper\gradle-wrapper.properties 文件,記事本打開,內容如下:

`#Sun Sep 04 23:25:42 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip

最後一句,https://services.gradle.org/distributions/gradle-2.14.1-all.zip

我遇到兩種情況,第一種 文本中網址有誤。如:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
(多了個 \)

第二種 網址正常,studio會下載上面的Gradle,不知道什麼原因下載不下來,我們可以手動下載這個版本的Gradle,無需解壓直接拷貝到

C:\Users\Administrator.gradle\wrapper\dists\gradle-2.10-all\a4w5fzrkeut1ox71xslb49gst

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章