mavenCentral()不是在工作,而是jcenter()。当我使用mavenCentral()时,我得到了下面的错误消息,
Could not HEAD 'https://google.bintray.com/flexbox-layout/com/google/android/flexbox/2.0.1/flexbox-2.0.1.pom'. Received status code 403 from server: Forbidden
Disable Gradle 'offline mode' and sync project以上使用jcenter(),错误不会出现。
我是否可以在我的项目中使用jcenter(),即使在jcenter()被弃用之后。jcenter()在我们的项目中使用的最后日期是什么?
项目build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.3'
classpath 'com.google.gms:google-services:4.3.8'
//classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.24.4"
}
}
allprojects {
/*apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'*/
repositories {
google()
mavenCentral()
}
}模块build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
defaultConfig {
applicationId "io.kommunicate.app"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
//Sensitive data
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
allprojects {
repositories {
google()
mavenCentral()
//jcenter()
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//api project(':kommunicateui')
implementation 'io.kommunicate.sdk:kommunicateui:2.1.8'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.multidex:multidex:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
apply plugin: 'com.google.gms.google-services'发布于 2021-08-23 11:31:48
Maven Central上没有flexbox。flexbox on 谷歌的Maven回购,但只有3.0.0。你的一些暂时性的依赖正在寻求2.0.1。而且,基于这个依赖列表,寻找旧的io.kommunicate.sdk:kommunicateui:2.1.8必须是flexbox。
不幸的是,显然,io.kommunicate.sdk:kommunicateui的开发人员没有更新他们的库。
您可以尝试手动添加您自己对com.google.android.flexbox:flexbox:3.0.0的依赖,也许还可以在io.kommunicate.sdk:kommunicateui:2.1.8依赖项上设置一个exclude规则,告诉Gradle忽略它对flexbox的传递依赖。理想情况下,io.kommunicate.sdk:kommunicateui的开发人员将更新他们的库以依赖于com.google.android.flexbox:flexbox:3.0.0。
若要排除失败的依赖关系,请更改:
implementation 'io.kommunicate.sdk:kommunicateui:2.1.8'至:
implementation('io.kommunicate.sdk:kommunicateui:2.1.8') {
exclude group: "com.google.android", module: "flexbox"
}发布于 2021-08-23 11:39:35
问题在FlexBox Layout library中
https://google.bintray.com/flexbox-layout/com/google/android/flexbox/2.0.1/flexbox-2.0.1.pom
不管什么原因你都被禁止了。有一个mavenCentral()工件使用flexbox 3.0.0,如果您可以使用该工件。
https://maven.google.com/web/index.html?q=flexbox#com.google.android.flexbox:flexbox:3.0.0
应该添加此依赖项(或在io.kCommunicate.sdk:kommunicateui:2.1.8或使用flexbox的依赖项中添加排除规则)
dependencies {
....
implementation 'com.google.android.flexbox:flexbox:3.0.0'
....
}要获得更多信息,请阅读下面的帖子
https://github.com/google/flexbox-layout/issues/566#issuecomment-844630491
https://stackoverflow.com/questions/68891571
复制相似问题