mavenCentral() 不工作,而是 jcenter()

Ami*_*dav 7 android deprecated jcenter

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
Run Code Online (Sandbox Code Playgroud)

使用 jcenter() 不会出现上述错误。

即使 jcenter() 已被弃用,我也可以在我的项目中使用 jcenter() 吗?在我们的项目中使用 jcenter() 的最后日期是哪一天。

项目构建.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()
    }
}
Run Code Online (Sandbox Code Playgroud)

模块构建.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'
Run Code Online (Sandbox Code Playgroud)

Com*_*are 8

flexboxMaven Central 上没有。Google 的 Maven 存储库上有一个,但只有. 您的一些传递依赖正在寻求 2.0.1。并且,根据该依赖项列表,它一定是在寻找较旧的.flexbox3.0.0io.kommunicate.sdk:kommunicateui:2.1.8flexbox

不幸的是,显然,开发人员io.kommunicate.sdk:kommunicateui还没有更新他们的库。

您可以尝试手动添加自己的依赖项com.google.android.flexbox:flexbox:3.0.0,也许还可以在该依赖项上设置一条exclude规则io.kommunicate.sdk:kommunicateui:2.1.8,以告诉 Gradle 忽略其对 的传递依赖项flexbox。理想情况下,开发人员io.kommunicate.sdk:kommunicateui将更新他们的库以依赖于com.google.android.flexbox:flexbox:3.0.0.

要排除失败的依赖项,请更改:

implementation 'io.kommunicate.sdk:kommunicateui:2.1.8'
Run Code Online (Sandbox Code Playgroud)

到:

implementation('io.kommunicate.sdk:kommunicateui:2.1.8') {
  exclude group: "com.google.android", module: "flexbox"
}
Run Code Online (Sandbox Code Playgroud)