错误:无法使用 Gradle 安装运行构建操作(gradle 2.4,android studio)

2023-02-01移动开发问题
201

本文介绍了错误:无法使用 Gradle 安装运行构建操作(gradle 2.4,android studio)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我刚刚更新了 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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

如何在 COCOS2d Android 中使用 CClistview?
How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)...
2024-08-12 移动开发问题
5

cocos2d-android:如何显示分数
cocos2d-android: how to display score(cocos2d-android:如何显示分数)...
2024-08-11 移动开发问题
7

Sqlite 数据库未从资产文件夹 Android 复制
Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)...
2024-04-15 移动开发问题
8

SQLite 数据库副本在由设备而不是模拟器生成时出现损坏
SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)...
2024-04-15 移动开发问题
4

安卓文件拷贝
Android file copy(安卓文件拷贝)...
2024-04-15 移动开发问题
6

Android如何在android中检测Edittext的Copy事件
Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)...
2024-04-15 移动开发问题
5