小编Mad*_*ddy的帖子

Gradle - 无法创建工具 API 实现的实例

我正在尝试从 GitHub 导入一个项目并在 Android Studio 上构建/运行它。我收到以下错误:

“错误:无法使用指定的 Gradle 发行版‘ https://services.gradle.org/distributions/gradle-2.4-all.zip ’创建工具 API 实现的实例。”

我尝试了以下方法:

  1. 使缓存无效并重新启动
  2. 将 gradle-wrapper/properties 中的 distributionURL 更改为 2.5 等。
  3. 删除 build.gradle 并重新启动

这些是我从 stackoverflow 上的其他几篇文章中得到的想法,所以我无法解释我为什么尝试这些。(我对 Android Studio 非常陌生)。

我的build.gradle文件看起来像这样:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    } }

allprojects { …
Run Code Online (Sandbox Code Playgroud)

android gradle android-studio android-gradle-plugin gradle-tooling-api

4
推荐指数
1
解决办法
2万
查看次数