java.lang.nosuchmethoderror:无虚拟方法setParameters(lcom/google/google/android/exoplayer2/trackSelection/defaultTrackSelector $ paramet

发布于 2025-02-10 06:53:52 字数 17436 浏览 1 评论 0 原文

我正在与BrightCove视频播放器面对这个问题。玩家在内部使用外层器。运行应用程序时,播放器仅显示视频的海报,但是单击播放时会给下面提到的错误msg。 我在应用程序中实现了多个模块,1个模块使用EXO Player 2.17.1,而1模块则使用BrightCove 6.18.6使用EXO Player 2.14。

E/com.brightcove.player.event.EventEmitterImpl@b1bc2d5: processEvent() threw a throwable.
java.lang.NoSuchMethodError: No virtual method setParameters(Lcom/google/android/exoplayer2/trackselection/DefaultTrackSelector$Parameters;)V in class Lcom/google/android/exoplayer2/trackselection/DefaultTrackSelector; or its super classes (declaration of 'com.google.android.exoplayer2.trackselection.DefaultTrackSelector' appears in /data/app/~~IcHQVEM5w4IXny6I30aQ9g==/com.test.demo-upkrdit2H5SqzTzsEzy8jw==/base.apk!classes2.dex)
    at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.updateTrackSelectorPeakBitrate(ExoPlayerVideoDisplayComponent.java:2052)
    at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.initializePlayer(ExoPlayerVideoDisplayComponent.java:1028)
    at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.createPlayer(ExoPlayerVideoDisplayComponent.java:1015)
    at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.openVideo(ExoPlayerVideoDisplayComponent.java:1086)
    at com.brightcove.player.display.VideoDisplayComponent.openCurrentVideoSource(VideoDisplayComponent.java:470)
    at com.brightcove.player.display.ExoPlayerVideoDisplayComponent$ExoPlayerOnSetSourceListener.processEvent(ExoPlayerVideoDisplayComponent.java:1288)
    at com.brightcove.player.event.EventEmitterImpl.invokeListenersForEventType(EventEmitterImpl.java:458)
    at com.brightcove.player.event.EventEmitterImpl.invokeListenersForEvent(EventEmitterImpl.java:429)
    at com.brightcove.player.event.EventEmitterImpl.access$300(EventEmitterImpl.java:42)
    at com.brightcove.player.event.EventEmitterImpl$1.handleMessage(EventEmitterImpl.java:74)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:257)
    at android.app.ActivityThread.main(ActivityThread.java:8218)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)

2022-06-24 10:48:46.138 31056-31056/com.test.demo E/com.brightcove.player.event.EventEmitterImpl@987c257: processEvent() threw a throwable.
    java.lang.NoSuchMethodError: No virtual method setParameters(Lcom/google/android/exoplayer2/trackselection/DefaultTrackSelector$Parameters;)V in class Lcom/google/android/exoplayer2/trackselection/DefaultTrackSelector; or its super classes (declaration of 'com.google.android.exoplayer2.trackselection.DefaultTrackSelector' appears in /data/app/~~IcHQVEM5w4IXny6I30aQ9g==/com.test.demo-upkrdit2H5SqzTzsEzy8jw==/base.apk!classes2.dex)
        at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.updateTrackSelectorPeakBitrate(ExoPlayerVideoDisplayComponent.java:2052)
        at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.initializePlayer(ExoPlayerVideoDisplayComponent.java:1028)
        at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.createPlayer(ExoPlayerVideoDisplayComponent.java:1015)
        at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.openVideo(ExoPlayerVideoDisplayComponent.java:1086)
        at com.brightcove.player.display.VideoDisplayComponent.openCurrentVideoSource(VideoDisplayComponent.java:470)
        at com.brightcove.player.display.ExoPlayerVideoDisplayComponent$ExoPlayerOnSetSourceListener.processEvent(ExoPlayerVideoDisplayComponent.java:1288)
        at com.brightcove.player.event.EventEmitterImpl.invokeListenersForEventType(EventEmitterImpl.java:458)
        at com.brightcove.player.event.EventEmitterImpl.invokeListenersForEvent(EventEmitterImpl.java:429)
        at com.brightcove.player.event.EventEmitterImpl.access$300(EventEmitterImpl.java:42)
        at com.brightcove.player.event.EventEmitterImpl$1.handleMessage(EventEmitterImpl.java:74)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:257)
        at android.app.ActivityThread.main(ActivityThread.java:8218)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)

我的项目配置是

    /*
 * Copyright (C) 2016 - present Instructure, Inc.
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, version 3 of the License.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

import com.test.android.buildtools.transform.*

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.squareup.sqldelight'
apply plugin: 'dagger.hilt.android.plugin'

def updatePriority = 2
def coverageEnabled = project.hasProperty('coverage')

sqldelight {
    StudentDb {
        packageName = "com.test.student.db"
        sourceFolders = ["db"]
        schemaOutputDirectory = file("src/main/db/schemas")
    }
}


configurations {
    all*.exclude group: 'commons-logging', module: 'commons-logging'
    all*.exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}

androidExtensions {
    experimental = true
}

android {
    compileSdkVersion Versions.COMPILE_SDK
    buildToolsVersion Versions.BUILD_TOOLS

    defaultConfig {
        applicationId "com.test.app"
        minSdkVersion Versions.MIN_SDK
        targetSdkVersion Versions.TARGET_SDK
        versionCode = 236
        versionName = '6.16.3'

        vectorDrawables.useSupportLibrary = true
        multiDexEnabled = true
        testInstrumentationRunner 'com.test.student.espresso.StudentHiltTestRunner'
        testInstrumentationRunnerArguments disableAnalytics: 'true'
        buildConfigField "boolean", "IS_TESTING", "false"

        /* Add private data */
        PrivateData.merge(project, "student")
        testBuildType = "debug"
        multiDexKeepFile = file('multidex-config.txt')
    }

    bundle {
        language {
            // Specifies that the app bundle should not support configuration APKs for language resources. These
            // resources are instead packaged with each base and dynamic feature APK.
            enableSplit = false
        }
    }

    packagingOptions {
        exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
        exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/rxjava.properties'
        exclude 'LICENSE.txt'
    }

    lintOptions {
        abortOnError false
        // Work around for AGP issue related to release mode, see:
        // https://github.com/flutter/flutter/issues/58247#issuecomment-636253593
        checkReleaseBuilds false
    }

    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
    }

    buildTypes {

        debug {
            testCoverageEnabled = coverageEnabled
            debuggable true
            minifyEnabled false
            shrinkResources false
            buildConfigField 'boolean', 'IS_DEBUG', 'true'
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            pseudoLocalesEnabled true
            multiDexKeepProguard = file('multidex-config.pro')

            firebaseCrashlytics {
                mappingFileUploadEnabled false
            }

            ndk {
                // Filter for architectures supported by Flutter. Include x86 in debug builds so we don't crash on FTL.
                abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64', 'x86'
            }
        }

        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            buildConfigField 'boolean', 'IS_DEBUG', 'false'
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            multiDexKeepProguard = file('multidex-config.pro')
            firebaseCrashlytics {
                nativeSymbolUploadEnabled true
            }

            ndk {
                // Filter for architectures supported by Flutter. Exclude x86 in release builds to avoid missing lib crash on x86 devices.
                abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
            }
        }
    }

    flavorDimensions 'default'

    productFlavors {
        dev {
            dimension 'default'
        }

        qa {
            buildConfigField "boolean", "IS_TESTING", "true"
            dimension 'default'
        }

        prod {
            dimension 'default'
        }
    }

    // Always show the result of every unit test, even if it passes.
    testOptions.unitTests.all {
        testLogging {
            events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
        }
    }

    testOptions.unitTests.includeAndroidResources = true
    testOptions.animationsDisabled = true

    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
        /*
        Resolves dependency versions across test and production APKs, specifically, transitive
        dependencies. This is required since Espresso internally has a dependency on support-annotations.
        https://github.com/googlecodelabs/android-testing/blob/57852eaf7df88ddaf828eca879a407f2249d5348/app/build.gradle#L86
        */
        resolutionStrategy.force Libs.ANDROIDX_ANNOTATION

        resolutionStrategy.force Libs.KOTLIN_COROUTINES_CORE

        // Some libraries want to resolve never versions of this library that requires targetSdkVersion 31.
        // Once we upgrade the targetSdkVersion this should be removed.
        resolutionStrategy.force 'androidx.core:core:1.6.0'
        resolutionStrategy.force 'androidx.core:core-ktx:1.6.0'
    }

    /*
    All direct/transitive dependencies shared between your test and production APKs need to be
    excluded from the test APK! This is necessary because both APKs will contain the same classes. Not
    excluding these dependencies from your test configuration will result in an dex pre-verifier error
    at runtime. More info in this tools bug: (https://code.google.com/p/android/issues/detail?id=192497)
    */
    configurations.implementation.dependencies.each { compileDependency ->
        println "Excluding compile dependency: ${compileDependency.getName()}"
        configurations.androidTestImplementation.dependencies.each { androidTestCompileDependency ->
            configurations.androidTestImplementation.exclude module: "${compileDependency.getName()}"
        }
    }

    dexOptions {
        javaMaxHeapSize '4g'
    }

    registerTransform(
            new ProjectTransformer(
                    android,
                    new MasqueradeUITransformer('com.test.app.activity.NavigationActivity.class'),
                    new PageViewTransformer(),
                    new ScreenViewTransformer("user"),
                    new LocaleTransformer(project),
                    new FlutterA11yOffsetTransformer(),
                    new FlutterTextureDisconnectFix()
            )
    )

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8.toString()
    }

    buildFeatures {
        dataBinding true
    }
    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
    }

    hilt {
        enableTransformForLocalTests = true
    }
}

dependencies {
    implementation 'com.android.support:multidex:2.0.1'
    implementation project(path: ':panda_annotations')
    kaptAndroidTestQa project(path: ':panda_processor')
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    /* Project Modules */
    implementation project(path: ':login-api-2')
    implementation project(path: ':rceditor')
    implementation project(path: ':interactions')
    implementation project(path: ':DocumentScanner')

    /* Flutter embed */
    implementation(project(path: ':flutter-student-embed')) {
        exclude group: 'com.google.firebase'
        exclude group: 'com.google.android.gms'
    }

    /* Android Test Dependencies */
    androidTestImplementation project(path: ':espresso')
    androidTestImplementation project(':dataseedingapi')

    /* Unit Test Dependencies */
    testImplementation Libs.JUNIT
    testImplementation Libs.ROBOLECTRIC
    testImplementation Libs.ANDROIDX_TEST_JUNIT
    testImplementation Libs.MOCKK
    androidTestImplementation Libs.ANDROIDX_TEST_JUNIT
    testImplementation Libs.KOTLIN_COROUTINES_TEST
    testImplementation Libs.FIREBASE_CORE
    testImplementation Libs.THREETEN_BP
    testImplementation Libs.ANDROIDX_CORE_TESTING

    /* Firebase */
    implementation platform(Libs.FIREBASE_BOM)
    implementation Libs.FIREBASE_MESSAGING
    implementation Libs.FIREBASE_CRASHLYTICS_NDK
    implementation(Libs.FIREBASE_ANALYTICS) {
        transitive = true
    }
    implementation(Libs.FIREBASE_CRASHLYTICS) {
        transitive = true
    }

    /* Kotlin */
    implementation Libs.KOTLIN_STD_LIB

    /* Mobius */
    implementation Libs.MOBIUS_CORE
    testImplementation Libs.MOBIUS_TEST
    implementation Libs.MOBIUS_ANDROID
    implementation Libs.MOBIUS_EXTRAS

    /* Media Handling */
    implementation Libs.PHOTO_VIEW
    implementation Libs.LOTTIE

    /* Sliding Panel */
    implementation Libs.SLIDING_UP_PANEL

    /* Apache Commons */
    implementation Libs.APACHE_COMMONS_TEXT

    /* Support dependencies */
    implementation Libs.ANDROIDX_ANNOTATION
    implementation (Libs.ANDROIDX_APPCOMPAT) {
        force = true
    }
    implementation Libs.ANDROIDX_BROWSER
    implementation Libs.ANDROIDX_CARDVIEW
    implementation Libs.ANDROIDX_CONSTRAINT_LAYOUT
    implementation Libs.ANDROIDX_DESIGN
    implementation Libs.ANDROIDX_RECYCLERVIEW
    implementation Libs.PLAY_SERVICES_ANALYTICS
    implementation Libs.ANDROIDX_PALETTE
    implementation Libs.PLAY_CORE

    /* Database */
    implementation Libs.SQLDELIGHT

    /* Qr Code */
    implementation Libs.JOURNEY_ZXING

    /* AAC */
    implementation Libs.VIEW_MODEL
    implementation Libs.LIVE_DATA
    implementation Libs.VIEW_MODE_SAVED_STATE
    implementation Libs.FRAGMENT_KTX
    kapt Libs.LIFECYCLE_COMPILER

    /* DI */
    implementation Libs.HILT
    kapt Libs.HILT_COMPILER
    androidTestImplementation Libs.HILT_TESTING
    kaptAndroidTestQa Libs.HILT_TESTING_COMPILER

    androidTestImplementation Libs.UI_AUTOMATOR

    /*PDF READER*/
    implementation Libs.PDF_READER

    /*BrightCove video*/
    implementation Libs.BRIGHT_COV_VIDEO
    implementation "com.brightcove.player:android-appcompat-plugin:6.18.6"

    /*Viewpager video player*/
    implementation Libs.VIEW_PAGER

    /*JSOUP*/
    implementation Libs.JSOUP
}

// Comment out this line if the reporting logic starts going wonky.
gradle.addListener new TimingsListener(project)

apply plugin: 'com.google.gms.google-services'

if (coverageEnabled) {
    // ./gradlew -Pcoverage firebaseJacoco
    task firebaseJacoco(type: JacocoReport) {
        group = "Reporting"
        description = "Generate Jacoco coverage reports for Firebase test lab."

        def productFlavor = 'qa'
        def buildType = 'debug'

        classDirectories.setFrom fileTree(
                dir: "${project.buildDir}/tmp/kotlin-classes/qaDebug",
                excludes: ['**/R.class',
                           '**/R$*.class',
                           '**/*$ViewInjector*.*',
                           '**/*$ViewBinder*.*',
                           '**/BuildConfig.*',
                           '**/Manifest*.*',
                           '**/generated/**',
                           '**/*Receiver*.*',
                           '**/model*/**',
                           '**/di/**',
                           '**/service*/**'],
        )

    }

}

我的progaurd文件是

-keep public class com.google.android.exoplayer2.**{*;}
-keep public class com.brightcove.player.**{*;}
-keep  interface com.google.android.exoplayer2.**{*;}
-keep  interface com.brightcove.player.**{*;}

-keepclassmembers class ** {
    @com.google.android.exoplayer2.trackselection.DefaultTrackSelector$Parameters <methods>;
}


-keepclasseswithmembers class * {
    @com.brightcove.player.* <methods>;
}

我的模块之一,它使用EXO Player作为单独的依赖项,一个模块使用BrightCove Player。

I am facing this issue with BrightCove Video player. The player uses the exoplayer internally. When running the app the player shows only poster of the video but when clicking the play gives the below mentioned error msg.
I have multiple modules implemented in the app, and 1 module is using exo player 2.17.1 and 1 module is using brightcove 6.18.6 with exo player 2.14.

E/com.brightcove.player.event.EventEmitterImpl@b1bc2d5: processEvent() threw a throwable.
java.lang.NoSuchMethodError: No virtual method setParameters(Lcom/google/android/exoplayer2/trackselection/DefaultTrackSelector$Parameters;)V in class Lcom/google/android/exoplayer2/trackselection/DefaultTrackSelector; or its super classes (declaration of 'com.google.android.exoplayer2.trackselection.DefaultTrackSelector' appears in /data/app/~~IcHQVEM5w4IXny6I30aQ9g==/com.test.demo-upkrdit2H5SqzTzsEzy8jw==/base.apk!classes2.dex)
    at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.updateTrackSelectorPeakBitrate(ExoPlayerVideoDisplayComponent.java:2052)
    at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.initializePlayer(ExoPlayerVideoDisplayComponent.java:1028)
    at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.createPlayer(ExoPlayerVideoDisplayComponent.java:1015)
    at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.openVideo(ExoPlayerVideoDisplayComponent.java:1086)
    at com.brightcove.player.display.VideoDisplayComponent.openCurrentVideoSource(VideoDisplayComponent.java:470)
    at com.brightcove.player.display.ExoPlayerVideoDisplayComponent$ExoPlayerOnSetSourceListener.processEvent(ExoPlayerVideoDisplayComponent.java:1288)
    at com.brightcove.player.event.EventEmitterImpl.invokeListenersForEventType(EventEmitterImpl.java:458)
    at com.brightcove.player.event.EventEmitterImpl.invokeListenersForEvent(EventEmitterImpl.java:429)
    at com.brightcove.player.event.EventEmitterImpl.access$300(EventEmitterImpl.java:42)
    at com.brightcove.player.event.EventEmitterImpl$1.handleMessage(EventEmitterImpl.java:74)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:257)
    at android.app.ActivityThread.main(ActivityThread.java:8218)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)

2022-06-24 10:48:46.138 31056-31056/com.test.demo E/com.brightcove.player.event.EventEmitterImpl@987c257: processEvent() threw a throwable.
    java.lang.NoSuchMethodError: No virtual method setParameters(Lcom/google/android/exoplayer2/trackselection/DefaultTrackSelector$Parameters;)V in class Lcom/google/android/exoplayer2/trackselection/DefaultTrackSelector; or its super classes (declaration of 'com.google.android.exoplayer2.trackselection.DefaultTrackSelector' appears in /data/app/~~IcHQVEM5w4IXny6I30aQ9g==/com.test.demo-upkrdit2H5SqzTzsEzy8jw==/base.apk!classes2.dex)
        at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.updateTrackSelectorPeakBitrate(ExoPlayerVideoDisplayComponent.java:2052)
        at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.initializePlayer(ExoPlayerVideoDisplayComponent.java:1028)
        at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.createPlayer(ExoPlayerVideoDisplayComponent.java:1015)
        at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.openVideo(ExoPlayerVideoDisplayComponent.java:1086)
        at com.brightcove.player.display.VideoDisplayComponent.openCurrentVideoSource(VideoDisplayComponent.java:470)
        at com.brightcove.player.display.ExoPlayerVideoDisplayComponent$ExoPlayerOnSetSourceListener.processEvent(ExoPlayerVideoDisplayComponent.java:1288)
        at com.brightcove.player.event.EventEmitterImpl.invokeListenersForEventType(EventEmitterImpl.java:458)
        at com.brightcove.player.event.EventEmitterImpl.invokeListenersForEvent(EventEmitterImpl.java:429)
        at com.brightcove.player.event.EventEmitterImpl.access$300(EventEmitterImpl.java:42)
        at com.brightcove.player.event.EventEmitterImpl$1.handleMessage(EventEmitterImpl.java:74)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:257)
        at android.app.ActivityThread.main(ActivityThread.java:8218)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)

My project config is

    /*
 * Copyright (C) 2016 - present Instructure, Inc.
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, version 3 of the License.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

import com.test.android.buildtools.transform.*

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.squareup.sqldelight'
apply plugin: 'dagger.hilt.android.plugin'

def updatePriority = 2
def coverageEnabled = project.hasProperty('coverage')

sqldelight {
    StudentDb {
        packageName = "com.test.student.db"
        sourceFolders = ["db"]
        schemaOutputDirectory = file("src/main/db/schemas")
    }
}


configurations {
    all*.exclude group: 'commons-logging', module: 'commons-logging'
    all*.exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}

androidExtensions {
    experimental = true
}

android {
    compileSdkVersion Versions.COMPILE_SDK
    buildToolsVersion Versions.BUILD_TOOLS

    defaultConfig {
        applicationId "com.test.app"
        minSdkVersion Versions.MIN_SDK
        targetSdkVersion Versions.TARGET_SDK
        versionCode = 236
        versionName = '6.16.3'

        vectorDrawables.useSupportLibrary = true
        multiDexEnabled = true
        testInstrumentationRunner 'com.test.student.espresso.StudentHiltTestRunner'
        testInstrumentationRunnerArguments disableAnalytics: 'true'
        buildConfigField "boolean", "IS_TESTING", "false"

        /* Add private data */
        PrivateData.merge(project, "student")
        testBuildType = "debug"
        multiDexKeepFile = file('multidex-config.txt')
    }

    bundle {
        language {
            // Specifies that the app bundle should not support configuration APKs for language resources. These
            // resources are instead packaged with each base and dynamic feature APK.
            enableSplit = false
        }
    }

    packagingOptions {
        exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
        exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/rxjava.properties'
        exclude 'LICENSE.txt'
    }

    lintOptions {
        abortOnError false
        // Work around for AGP issue related to release mode, see:
        // https://github.com/flutter/flutter/issues/58247#issuecomment-636253593
        checkReleaseBuilds false
    }

    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
    }

    buildTypes {

        debug {
            testCoverageEnabled = coverageEnabled
            debuggable true
            minifyEnabled false
            shrinkResources false
            buildConfigField 'boolean', 'IS_DEBUG', 'true'
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            pseudoLocalesEnabled true
            multiDexKeepProguard = file('multidex-config.pro')

            firebaseCrashlytics {
                mappingFileUploadEnabled false
            }

            ndk {
                // Filter for architectures supported by Flutter. Include x86 in debug builds so we don't crash on FTL.
                abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64', 'x86'
            }
        }

        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            buildConfigField 'boolean', 'IS_DEBUG', 'false'
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            multiDexKeepProguard = file('multidex-config.pro')
            firebaseCrashlytics {
                nativeSymbolUploadEnabled true
            }

            ndk {
                // Filter for architectures supported by Flutter. Exclude x86 in release builds to avoid missing lib crash on x86 devices.
                abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
            }
        }
    }

    flavorDimensions 'default'

    productFlavors {
        dev {
            dimension 'default'
        }

        qa {
            buildConfigField "boolean", "IS_TESTING", "true"
            dimension 'default'
        }

        prod {
            dimension 'default'
        }
    }

    // Always show the result of every unit test, even if it passes.
    testOptions.unitTests.all {
        testLogging {
            events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
        }
    }

    testOptions.unitTests.includeAndroidResources = true
    testOptions.animationsDisabled = true

    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
        /*
        Resolves dependency versions across test and production APKs, specifically, transitive
        dependencies. This is required since Espresso internally has a dependency on support-annotations.
        https://github.com/googlecodelabs/android-testing/blob/57852eaf7df88ddaf828eca879a407f2249d5348/app/build.gradle#L86
        */
        resolutionStrategy.force Libs.ANDROIDX_ANNOTATION

        resolutionStrategy.force Libs.KOTLIN_COROUTINES_CORE

        // Some libraries want to resolve never versions of this library that requires targetSdkVersion 31.
        // Once we upgrade the targetSdkVersion this should be removed.
        resolutionStrategy.force 'androidx.core:core:1.6.0'
        resolutionStrategy.force 'androidx.core:core-ktx:1.6.0'
    }

    /*
    All direct/transitive dependencies shared between your test and production APKs need to be
    excluded from the test APK! This is necessary because both APKs will contain the same classes. Not
    excluding these dependencies from your test configuration will result in an dex pre-verifier error
    at runtime. More info in this tools bug: (https://code.google.com/p/android/issues/detail?id=192497)
    */
    configurations.implementation.dependencies.each { compileDependency ->
        println "Excluding compile dependency: ${compileDependency.getName()}"
        configurations.androidTestImplementation.dependencies.each { androidTestCompileDependency ->
            configurations.androidTestImplementation.exclude module: "${compileDependency.getName()}"
        }
    }

    dexOptions {
        javaMaxHeapSize '4g'
    }

    registerTransform(
            new ProjectTransformer(
                    android,
                    new MasqueradeUITransformer('com.test.app.activity.NavigationActivity.class'),
                    new PageViewTransformer(),
                    new ScreenViewTransformer("user"),
                    new LocaleTransformer(project),
                    new FlutterA11yOffsetTransformer(),
                    new FlutterTextureDisconnectFix()
            )
    )

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8.toString()
    }

    buildFeatures {
        dataBinding true
    }
    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
    }

    hilt {
        enableTransformForLocalTests = true
    }
}

dependencies {
    implementation 'com.android.support:multidex:2.0.1'
    implementation project(path: ':panda_annotations')
    kaptAndroidTestQa project(path: ':panda_processor')
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    /* Project Modules */
    implementation project(path: ':login-api-2')
    implementation project(path: ':rceditor')
    implementation project(path: ':interactions')
    implementation project(path: ':DocumentScanner')

    /* Flutter embed */
    implementation(project(path: ':flutter-student-embed')) {
        exclude group: 'com.google.firebase'
        exclude group: 'com.google.android.gms'
    }

    /* Android Test Dependencies */
    androidTestImplementation project(path: ':espresso')
    androidTestImplementation project(':dataseedingapi')

    /* Unit Test Dependencies */
    testImplementation Libs.JUNIT
    testImplementation Libs.ROBOLECTRIC
    testImplementation Libs.ANDROIDX_TEST_JUNIT
    testImplementation Libs.MOCKK
    androidTestImplementation Libs.ANDROIDX_TEST_JUNIT
    testImplementation Libs.KOTLIN_COROUTINES_TEST
    testImplementation Libs.FIREBASE_CORE
    testImplementation Libs.THREETEN_BP
    testImplementation Libs.ANDROIDX_CORE_TESTING

    /* Firebase */
    implementation platform(Libs.FIREBASE_BOM)
    implementation Libs.FIREBASE_MESSAGING
    implementation Libs.FIREBASE_CRASHLYTICS_NDK
    implementation(Libs.FIREBASE_ANALYTICS) {
        transitive = true
    }
    implementation(Libs.FIREBASE_CRASHLYTICS) {
        transitive = true
    }

    /* Kotlin */
    implementation Libs.KOTLIN_STD_LIB

    /* Mobius */
    implementation Libs.MOBIUS_CORE
    testImplementation Libs.MOBIUS_TEST
    implementation Libs.MOBIUS_ANDROID
    implementation Libs.MOBIUS_EXTRAS

    /* Media Handling */
    implementation Libs.PHOTO_VIEW
    implementation Libs.LOTTIE

    /* Sliding Panel */
    implementation Libs.SLIDING_UP_PANEL

    /* Apache Commons */
    implementation Libs.APACHE_COMMONS_TEXT

    /* Support dependencies */
    implementation Libs.ANDROIDX_ANNOTATION
    implementation (Libs.ANDROIDX_APPCOMPAT) {
        force = true
    }
    implementation Libs.ANDROIDX_BROWSER
    implementation Libs.ANDROIDX_CARDVIEW
    implementation Libs.ANDROIDX_CONSTRAINT_LAYOUT
    implementation Libs.ANDROIDX_DESIGN
    implementation Libs.ANDROIDX_RECYCLERVIEW
    implementation Libs.PLAY_SERVICES_ANALYTICS
    implementation Libs.ANDROIDX_PALETTE
    implementation Libs.PLAY_CORE

    /* Database */
    implementation Libs.SQLDELIGHT

    /* Qr Code */
    implementation Libs.JOURNEY_ZXING

    /* AAC */
    implementation Libs.VIEW_MODEL
    implementation Libs.LIVE_DATA
    implementation Libs.VIEW_MODE_SAVED_STATE
    implementation Libs.FRAGMENT_KTX
    kapt Libs.LIFECYCLE_COMPILER

    /* DI */
    implementation Libs.HILT
    kapt Libs.HILT_COMPILER
    androidTestImplementation Libs.HILT_TESTING
    kaptAndroidTestQa Libs.HILT_TESTING_COMPILER

    androidTestImplementation Libs.UI_AUTOMATOR

    /*PDF READER*/
    implementation Libs.PDF_READER

    /*BrightCove video*/
    implementation Libs.BRIGHT_COV_VIDEO
    implementation "com.brightcove.player:android-appcompat-plugin:6.18.6"

    /*Viewpager video player*/
    implementation Libs.VIEW_PAGER

    /*JSOUP*/
    implementation Libs.JSOUP
}

// Comment out this line if the reporting logic starts going wonky.
gradle.addListener new TimingsListener(project)

apply plugin: 'com.google.gms.google-services'

if (coverageEnabled) {
    // ./gradlew -Pcoverage firebaseJacoco
    task firebaseJacoco(type: JacocoReport) {
        group = "Reporting"
        description = "Generate Jacoco coverage reports for Firebase test lab."

        def productFlavor = 'qa'
        def buildType = 'debug'

        classDirectories.setFrom fileTree(
                dir: "${project.buildDir}/tmp/kotlin-classes/qaDebug",
                excludes: ['**/R.class',
                           '**/R$*.class',
                           '**/*$ViewInjector*.*',
                           '**/*$ViewBinder*.*',
                           '**/BuildConfig.*',
                           '**/Manifest*.*',
                           '**/generated/**',
                           '**/*Receiver*.*',
                           '**/model*/**',
                           '**/di/**',
                           '**/service*/**'],
        )

    }

}

My progaurd file is

-keep public class com.google.android.exoplayer2.**{*;}
-keep public class com.brightcove.player.**{*;}
-keep  interface com.google.android.exoplayer2.**{*;}
-keep  interface com.brightcove.player.**{*;}

-keepclassmembers class ** {
    @com.google.android.exoplayer2.trackselection.DefaultTrackSelector$Parameters <methods>;
}


-keepclasseswithmembers class * {
    @com.brightcove.player.* <methods>;
}

One of my module is using Exo player as a separate dependency and one module is using brightcove player.

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

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

发布评论

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

评论(2

雪化雨蝶 2025-02-17 06:53:53

旧参数DefaultTrackSelector最近使用您的问题可能与该更改有关。

The old parameters DefaultTrackSelector took have recently been deprecated with the 2.18.0 update and your problem might be related to that change.

岁月静好 2025-02-17 06:53:53

根据 2.14.2 使用BrightCove Player 6.18.6

implementation "com.brightcove.player:exoplayer2:6.18.6"

这很奇怪,因为它全是Androidx-然后是此插件: android-appCompat-Plugin

According to the documentation need to use Brightcove Player 6.18.6 with ExoPlayer 2.14.2.

implementation "com.brightcove.player:exoplayer2:6.18.6"

It's just strange, because it's all AndroidX - and then this plugin: android-appcompat-plugin??

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