找不到com.android.tools.build:gradle:3.5 [英] Could not find com.android.tools.build:gradle:3.5

查看:393
本文介绍了找不到com.android.tools.build:gradle:3.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to update gradle from 1.3.1 to 3.5, as some of my dependencies requires version 3.3 or above.

我见过类似的问题,但是没有一个帮助.

I've seen similar questions, but none of them help.

build.gradle :

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

gradle-wrapper.properties :

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

在尝试做任何事情(构建,清理等)时,我仍然得到了这个信息:

Still i'm getting this when trying to do anything (build, clean etc):

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

推荐答案

要解决此问题,请检查您在项目级别build.gradle 中是否有 google()回购文件.

To fix this issue check do you have google() repo in your project's level build.gradle file.

buildscript {
    repositories {
        jcenter()
        google() //HAVE YOU MISS IT?
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
    }
}

allprojects {
    repositories {
        jcenter()
        google() //HAVE YOU MISS IT?
    }
}

这篇关于找不到com.android.tools.build:gradle:3.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆