gradle Android Build因JCenter而失败

ffdz8vbo  于 2023-08-06  发布在  Android
关注(0)|答案(1)|浏览(163)

我试图通过Jenkins构建Android项目,但失败了。同样的构建是工作几天前,我没有在库中做任何更改。以下是相同的控制台日志:

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:minifySitWithR8'.
> Could not resolve all task dependencies for configuration ':app:sitCompileClasspath'.
> Could not resolve androidx.camera:camera-core:[1.1.0].
 Required by:
     project :app > androidx.camera:camera-lifecycle:1.1.0
     project :app > androidx.camera:camera-view:1.1.0
  > Failed to list versions for androidx.camera:camera-core.
     > Unable to load Maven meta-data from https://jcenter.bintray.com/androidx/camera/camera-core/maven-metadata.xml.
        > Could not get resource 'https://jcenter.bintray.com/androidx/camera/camera-core/maven-metadata.xml'.
           > Could not GET 'https://jcenter.bintray.com/androidx/camera/camera-core/maven-metadata.xml'. Received status code 403 from server: Forbidden

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

* Get more help at https://help.gradle.org

字符串
我在浏览器中检查访问https://jcenter.bintray.com/androidx/camera/camera-core/maven-metadata.xml,但我得到以下响应:

{
"errors" : [ {
"status" : 404,
"message" : "Maven metadata not found for 'androidx/camera/camera-core/maven-metadata.xml'."
} ]
}


下面是我的项目级gradle文件:

buildscript {
repositories {
    google()
    jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.6.4'
    classpath 'com.google.gms:google-services:4.3.4'
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
    classpath 'com.google.firebase:perf-plugin:1.3.3'  // Performance Monitoring plugin

}
}

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


应用级gradle文件:

android {
   compileSdkVersion 29
   buildToolsVersion "29.0.3"

defaultConfig {
    applicationId "com.a.b.c"
    minSdkVersion 21
    targetSdkVersion 29
    versionCode 385
    versionName "0.55.2"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
}


网址:gradle.properties

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


我不能移动到更高的gradle版本,这将迫使升级我的所有库,我不能设置目标版本超过29(它需要大的变化移动到31)
在这里需要建议

weylhg0b

weylhg0b1#

jcenter()从两个repositories密封中取出。androidx.camera:camera-core可从google()获得,您已经拥有了google()

相关问题