問題描述
我剛剛更新了 Android Studio,無法構建任何項目,甚至是新創建的項目.
I just update Android Studio and I can't build any project, even newly created ones.
我得到的錯誤是:
錯誤:無法使用 Gradle 分發運行構建操作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'.
我該怎么辦?
推薦答案
我們有兩個著名的方法來解決這個問題:
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 文件夾):默認位置是: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 目錄路徑:(更改為上面設置的文件夾)并點擊確定.
Open Android Studio: File/Settings/Gradle/Service directory path: (Change to folder you set above) and Click ok.
底部的狀態應該表明它很忙&錯誤應該被修復.
Status on bottom should indicate it's busy & error should be fixed.
第四步:
重啟 Android Studio
restart Android Studio
2- 刪除 .gradle 文件夾:
默認位置是:
C:Users[用戶名]gradlewrapperdists
C:Users[username]gradlewrapperdists
之后打開 Android Studio 并創建一個新項目(可能需要重新啟動).
after that open Android Studio and make a new project (might need to reastart).
這篇關于錯誤:無法使用 Gradle 安裝運行構建操作(gradle 2.4,android studio)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!