Android-没有Jcenter

发布于 2025-02-11 17:59:51 字数 2978 浏览 1 评论 0原文

我有一个Android Project,该项目使用JWplayer版本3版,该版本依次使用exoplayer。问题在于,现在我们收到一条消息,说jcenter()已贬低,使其与Gradle 8.0不相容。当我们删除jcenter()和构建时,我们现在会遇到以下错误:

Failed to resolve: com.google.android.exoplayer:exoplayer-core:2.10.6
Failed to resolve: com.google.android.exoplayer:exoplayer-dash:2.10.6
Failed to resolve: com.google.android.exoplayer:exoplayer-hls:2.10.6
Failed to resolve: com.google.android.exoplayer:exoplayer-smoothstreaming:2.10.6
Failed to resolve: com.google.android.exoplayer:exoplayer-ui:2.10.6

我们对凌空有类似的错误,但是更新版本号也照顾了问题。但是,我们将Exoplayer版本更新为2.11,这无济于事。

我们如何实现所有这些范围的依赖性?

更新: 我读到我可以指向Mavencentral或Google存储库,但我正在这样做,但我仍然会遇到错误。

构建gradle(项目):

buildscript {
repositories {
    google()
    mavenCentral()
    gradlePluginPortal()

}
dependencies {
    classpath 'com.android.tools.build:gradle:7.2.1'
    classpath 'com.google.gms:google-services:4.3.10'
    classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]'

    def nav_version = '2.4.1'
    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"

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

allprojects {
repositories {
    google()
    mavenCentral()

    maven {
        url 'https://mvn.jwplayer.com/content/repositories/releases/'
    }
    maven {
        url 'https://jitpack.io'
    }
}
}

构建gradle(app)

buildscript {
        repositories {
            google()
            maven { url 'https://plugins.gradle.org/m2/' }
        }
    }
    
    plugins {
        id 'com.onesignal.androidsdk.onesignal-gradle-plugin'
        id 'com.android.application'
    }
    
    repositories {
        maven { url 'https://maven.google.com' }
        maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
        maven { url 'https://swisscodemonkeys.github.io/appbrain-sdk/maven' }
        google()
        mavenCentral()
    }
    
    android {
        compileSdkVersion 31
        buildToolsVersion "30.0.3"
    
        defaultConfig {
            applicationId "com.xxxxx.xxxxxxxx"
            minSdkVersion 21
            multiDexEnabled true
            targetSdkVersion 31
            versionCode 15
            versionName "5.0.2"
    
    
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
    
        compileOptions {
            sourceCompatibility = '1.8'
            targetCompatibility = '1.8'
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }
    
    

I have an Android project that uses version 3 of JWPlayer which in turn uses Exoplayer. The problem is that now we get a message saying that JCenter() has been deprecate and makes it incompatible with Gradle 8.0. When we remove JCenter() and build, we now get the following errors:

Failed to resolve: com.google.android.exoplayer:exoplayer-core:2.10.6
Failed to resolve: com.google.android.exoplayer:exoplayer-dash:2.10.6
Failed to resolve: com.google.android.exoplayer:exoplayer-hls:2.10.6
Failed to resolve: com.google.android.exoplayer:exoplayer-smoothstreaming:2.10.6
Failed to resolve: com.google.android.exoplayer:exoplayer-ui:2.10.6

We got a similar error for Volley but updating the version number took care of the problem. However, we updated the exoplayer version to 2.11 and it didn't help.

How can we implement all of these exoplayer dependencies?

Update:
I have read that I can point to the mavenCentral or the google repositories but I am doing that and I still get the error.

Build gradle (project):

buildscript {
repositories {
    google()
    mavenCentral()
    gradlePluginPortal()

}
dependencies {
    classpath 'com.android.tools.build:gradle:7.2.1'
    classpath 'com.google.gms:google-services:4.3.10'
    classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]'

    def nav_version = '2.4.1'
    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"

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

allprojects {
repositories {
    google()
    mavenCentral()

    maven {
        url 'https://mvn.jwplayer.com/content/repositories/releases/'
    }
    maven {
        url 'https://jitpack.io'
    }
}
}

Build gradle (app)

buildscript {
        repositories {
            google()
            maven { url 'https://plugins.gradle.org/m2/' }
        }
    }
    
    plugins {
        id 'com.onesignal.androidsdk.onesignal-gradle-plugin'
        id 'com.android.application'
    }
    
    repositories {
        maven { url 'https://maven.google.com' }
        maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
        maven { url 'https://swisscodemonkeys.github.io/appbrain-sdk/maven' }
        google()
        mavenCentral()
    }
    
    android {
        compileSdkVersion 31
        buildToolsVersion "30.0.3"
    
        defaultConfig {
            applicationId "com.xxxxx.xxxxxxxx"
            minSdkVersion 21
            multiDexEnabled true
            targetSdkVersion 31
            versionCode 15
            versionName "5.0.2"
    
    
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
    
        compileOptions {
            sourceCompatibility = '1.8'
            targetCompatibility = '1.8'
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }
    
    

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光是把杀猪刀 2025-02-18 17:59:52

引用外层文档:

可以从 Google Maven Reposority )。

因此,如果您的存储库中的google(),则可以从那里获得2.13.0,并且可以从那里获得新的。

但是,我们将Exoplayer版本更新为2.11,并且无济于事

但是,我们将Exoplayer版本更新为2.11,根据您尝试使用哪个补丁级别的2至2.5岁 。现在的电流为2.18.0。

Quoting the ExoPlayer documentation:

ExoPlayer modules can be obtained from the Google Maven repository.

So, if you have google() in your repositories, you can get 2.13.0 and newer from there.

However, we updated the exoplayer version to 2.11 and it didn't help

That ranges from 2 to 2.5 years old, depending on which patch level you were trying. The now-current is 2.18.0.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文