为什么在我包含 exoplayer 2.8.4 的依赖项时下载 exoplayer 2.13.3?

Why does exoplayer 2.13.3 get downloaded, when I have included a dependency for exoplayer 2.8.4?

我想使用 exoplayer 2.8.4,它又将用于 Toro 库(自动播放回收器视图视频)。然而,我总是在我的应用程序中得到一个 exoplayer 2.13.3,这很奇怪,因为我没有将它包含在我的依赖项中。我尝试使缓存失效甚至清除缓存,但仍然安装了 exoplayer 2.13.3。 Toro 需要 exoplayer 2.8.4 才能正常工作。有人可以提供解决方案吗?

build.gradle(应用程序)

的代码
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'androidx.navigation.safeargs'


android {
    compileSdkVersion 31

    defaultConfig {
        applicationId "com.mypost.bazigar"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode 1
        versionName "1.1"
        buildConfigField 'String', 'BASE_URL', (project.findProperty("BASE_URL") ?: "")
        buildConfigField 'String', 'GIPHY_API', (project.findProperty("GIPHY_API") ?: "")
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildFeatures {
        viewBinding = true
    }
    buildTypes {

        release {

            lintOptions {
                checkReleaseBuilds false
                abortOnError false
            }

            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

            //Other parameters
            debuggable false
            jniDebuggable false
            renderscriptDebuggable false
            pseudoLocalesEnabled false
            zipAlignEnabled true

        }

        packagingOptions {
            pickFirst '**/*.so'
            exclude 'META-INF/library_release.kotlin_module'
        }

        bundle {
            language {
                enableSplit = false
            }

            configurations.all {
                resolutionStrategy {
                    force 'com.android.support:support-v4:27.1.0'
                }
            }
        }


    }

}


dependencies {

    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')

    implementation 'androidx.preference:preference:1.1.1'
    implementation 'androidx.annotation:annotation:1.2.0'
    implementation 'com.google.code.gson:gson:2.6.1'
    // okhttp3
    implementation 'com.squareup.okhttp3:okhttp:3.14.7'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
    implementation 'de.hdodenhof:circleimageview:3.0.2'
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    implementation 'com.google.firebase:firebase-auth:20.0.3'
    implementation 'com.google.firebase:firebase-database:19.7.0'
    implementation "com.github.zjupure:webpdecoder:2.0.4.11.0"
    api 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
    implementation "com.hendraanggrian.appcompat:socialview:0.2"
    implementation "com.hendraanggrian.appcompat:socialview-commons:0.2"
    implementation 'com.google.firebase:firebase-storage:19.2.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'

    implementation 'com.github.shts:StoriesProgressView:3.0.0'

// for image filter
    implementation 'com.github.zomato:androidphotofilters:1.0.2'
// for Dexter M
    implementation 'com.karumi:dexter:4.1.0'
    //image compression
    implementation 'com.makeramen:roundedimageview:2.3.0'

    implementation 'com.iceteck.silicompressorr:silicompressor:2.2.4'

    // DO NOT CHANGE ANY DEPENDENCIES
    implementation "com.tencent.liteav:LiteAVSDK_Professional:8.5.10033"


    implementation 'com.github.adityagohad:HorizontalPicker:1.0.1'
    implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
    implementation 'com.arthenica:mobile-ffmpeg-min:4.4.LTS'


    //
    implementation platform('com.google.firebase:firebase-bom:26.5.0')
    implementation 'com.google.firebase:firebase-auth-ktx'
    implementation 'com.google.firebase:firebase-messaging:22.0.0'
    implementation("androidx.browser:browser:1.3.0")
    implementation 'com.google.firebase:firebase-firestore-ktx:'


    //google location

    implementation 'com.google.android.gms:play-services-location:18.0.0'
    implementation 'org.jetbrains:annotations:15.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    implementation 'com.github.hoanganhtuan95ptit:AutoPlayVideoRecyclerView:1.0.1'
    implementation 'com.sprylab.android.texturevideoview:texturevideoview:1.2.1'
    implementation 'com.danikula:videocache:2.7.0'

    implementation "im.ene.toro3:toro:3.6.2.2804"
    implementation "im.ene.toro3:toro-ext-exoplayer:3.6.2.2804"
    implementation 'com.google.android.exoplayer:exoplayer:2.8.4'

    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

    //Snapchat login

    implementation 'com.snapchat.kit.sdk:login:1.10.0'
    implementation 'com.snapchat.kit.sdk:core:1.10.0'


    //Network Dependencies
    implementation 'com.google.code.gson:gson:2.8.6'
    //dont update okhttp3 use 3.8.0 and 2.7.2 for retrofit
    implementation 'com.squareup.okhttp3:logging-interceptor:3.3.1'
    implementation 'com.squareup.okhttp3:okhttp:3.8.0'
    implementation 'com.squareup.retrofit2:retrofit:2.7.2'
    implementation 'com.squareup.retrofit2:converter-scalars:2.7.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.7.2'
    //RxAndroid
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.18'
    //RxAndroid and Retrofit adapter
    implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'

    //giphy
    implementation 'com.giphy.sdk:ui:2.1.4'

    //vertical viewpager
    implementation 'com.github.castorflex.verticalviewpager:library:19.0.1'

    //Dagger
    def hilt_version = "2.38.1"

    implementation "com.google.dagger:hilt-android:$hilt_version"
    kapt "com.google.dagger:hilt-android-compiler:$hilt_version"

    implementation "com.squareup.retrofit2:converter-moshi:2.7.2"

    //viewmodel
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"


    //Coroutine
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3"
    implementation "androidx.activity:activity-ktx:1.3.1"

    implementation 'com.jakewharton.timber:timber:5.0.1'

    def nav_version = "2.3.5"
    implementation("androidx.navigation:navigation-fragment-ktx:$nav_version")
    implementation("androidx.navigation:navigation-ui-ktx:$nav_version")

    // Glide
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    kapt 'com.github.bumptech.glide:compiler:4.12.0'
}

build.gradle(项目)的代码

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
        flatDir {
            dirs 'src/main/jniLibs'
            dirs project(':app').file('libs')
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.3'
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
        classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31'

        def nav_version = "2.3.5"
        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()
        jcenter()
        maven {url  'https://maven.google.com'}
        maven {url  "https://storage.googleapis.com/snap-kit-build/maven"}
        maven {url "https://jitpack.io"}
        maven { url 'https://dl.bintray.com/umsdk/release' }
        maven { url 'https://4thline.org/m2' }
        maven {  url "https://giphy.bintray.com/giphy-sdk"}
    }
}

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

//ext {
//    compileSdkVersion = 25
//    buildToolsVersion = "28.0.3"
//    supportSdkVersion = "25.4.0"
//    minSdkVersion = 16
//    targetSdkVersion = 31
//    versionCode = 1
//    versionName = "v1.0"
//    proguard = true
//    rootPrj = "$projectDir/.."
//    ndkAbi = 'armeabi-v7a'
//    noffmpeg = false
//    noijkplay = false
//    aekit_version = '1.0.19-cloud'
//    liteavSdk="com.tencent.liteav:LiteAVSDK_Professional:latest.release"
//}

提前致谢!

我使用 strictly 关键字强制使用某个版本(阅读更多相关信息 here)。

这样使用:

implementation('com.google.android.exoplayer:exoplayer') {
    version {
        strictly '2.8.4'
    }
}

环顾四周,我发现了 force 关键字,(未测试)。