首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >找不到com.android.tools.build:gradle:3.5

找不到com.android.tools.build:gradle:3.5
EN

Stack Overflow用户
提问于 2017-04-19 13:32:31
回答 6查看 51.9K关注 0票数 23

我正在尝试将gradle从1.3.1更新到3.5,因为我的一些依赖项需要3.3或更高版本。

我也见过类似的问题,但都没有帮助。

build.gradle

代码语言:javascript
运行
复制
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5'
    }
}

gradle-wrapper.properties

代码语言:javascript
运行
复制
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip

不过,当我尝试做任何事情(建造、清洁等)时,我还是会得到这样的感觉:

代码语言:javascript
运行
复制
Building and installing the app on the device (cd android && ./gradlew installDebug...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'chat'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:3.5.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/gradle/3.5/gradle-3.5.pom
         https://jcenter.bintray.com/com/android/tools/build/gradle/3.5/gradle-3.5.jar
     Required by:
         project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
EN

Stack Overflow用户

发布于 2020-12-01 11:51:23

我在buildscriptallprojects存储库中都进行了Could not find gradle-3.5.3回购,但仍然显示了Could not find gradle-3.5.3错误。

最后,我添加了maven { url "https://maven.google.com" },它修复了错误!

项目级别build.gradle:

代码语言:javascript
运行
复制
buildscript {
    ext {
        buildToolsVersion = "29.0.2"
        minSdkVersion = 16
        compileSdkVersion = 29
        targetSdkVersion = 29
    }
    repositories {
        maven { url "https://maven.google.com" }  // <= this line
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.5.3")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url "https://maven.google.com" }  // <= this line
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        maven { url 'https://www.jitpack.io' }
    }
}
票数 1
EN
查看全部 6 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43497280

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档