Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom'

huangapple go评论69阅读模式
英文:

Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom'

问题

我在更新Gradle后遇到了以下问题。我无法找到任何解决方法。因此,请帮我解决以下问题。提前感谢...

(PROBLEM-----无法获取'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom'。 从服务器收到状态代码406:不可接受)

我的build.gradle文件...

// 顶层build文件,在此处可以添加所有子项目/模块都通用的配置选项。
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'

        // 注意:不要在此处放置应用程序的依赖项;它们应该放在各个模块的build.gradle文件中
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
英文:

I got the following problem after updating the Gradle. I was not able to find any solution for it.
So please help me to solve the following problem.
Thanks in advance...

(PROBLEM-----Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom'. Received status code 406 from server: Not Acceptable)

My build.gradle file...

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'

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

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

答案1

得分: 0

Android Gradle插件4.1.0尚未发布。请访问Google的Maven仓库。如果您想使用4.1.0,请尝试使用classpath 'com.android.tools.build:gradle:4.1.0-rc02'

英文:

Android Gradle plugin 4.1.0 is not release yet. see on Google's Maven Repository. Try classpath 'com.android.tools.build:gradle:4.1.0-rc02' if you want to use 4.1.0.

答案2

得分: 0

你应该设置 build.gradle(项目级别)

classpath 'com.android.tools.build:gradle:4.0.1'

并且在 gradle-wrapper.properties 文件中

distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

然后再次同步项目。

英文:

you should set build.gradle(project level)

classpath 'com.android.tools.build:gradle:4.0.1'

and in gradle-wrapper.properties file

distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

then sync again project.

huangapple
  • 本文由 发表于 2020年9月8日 09:22:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/63785967.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定