問題描述
我剛剛更新了 Android Studio,無法構(gòu)建任何項(xiàng)目,甚至是新創(chuàng)建的項(xiàng)目.
I just update Android Studio and I can't build any project, even newly created ones.
我得到的錯(cuò)誤是:
錯(cuò)誤:無法使用 Gradle 分發(fā)運(yùn)行構(gòu)建操作https://services.gradle.org/distributions/gradle-2.4.zip'.
Error:Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.4.zip'.
我該怎么辦?
推薦答案
我們有兩個(gè)著名的方法來解決這個(gè)問題:
We have two famous way for this problem:
1- 更新 gradle:
第 1 步:
從以下位置獲取 Android Studio 支持的最新版本:
Get latest version supported by Android Studio from:
https://services.gradle.org/distributions
第 2 步:
解壓 gradle 文件并安裝到 dists 文件夾(gradle 文件夾):默認(rèn)位置是:C:Users[username]gradlewrapperdists
Extract the gradle file and install to dists folder(gradle folder): default location is: C:Users[username]gradlewrapperdists
第三步:
打開 Android Studio:File/Settings/Gradle/Service 目錄路徑:(更改為上面設(shè)置的文件夾)并點(diǎn)擊確定.
Open Android Studio: File/Settings/Gradle/Service directory path: (Change to folder you set above) and Click ok.
底部的狀態(tài)應(yīng)該表明它很忙&錯(cuò)誤應(yīng)該被修復(fù).
Status on bottom should indicate it's busy & error should be fixed.
第四步:
重啟 Android Studio
restart Android Studio
2- 刪除 .gradle 文件夾:
默認(rèn)位置是:
C:Users[用戶名]gradlewrapperdists
C:Users[username]gradlewrapperdists
之后打開 Android Studio 并創(chuàng)建一個(gè)新項(xiàng)目(可能需要重新啟動(dòng)).
after that open Android Studio and make a new project (might need to reastart).
這篇關(guān)于錯(cuò)誤:無法使用 Gradle 安裝運(yùn)行構(gòu)建操作(gradle 2.4,android studio)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!