diff --git a/RELEASENOTES.md b/RELEASENOTES.md index ca4891ad37b..29ed960c3fc 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -6,6 +6,9 @@ * Fix bug where streams with highly uneven durations may get stuck in a buffering state ([#7943](https://github.com/google/ExoPlayer/issues/7943)). + * Switch Guava dependency from `implementation` to `api` + ([#7905](https://github.com/google/ExoPlayer/issues/7905), + ([#7993](https://github.com/google/ExoPlayer/issues/7993)). * Data sources: * Add support for `android.resource` URI scheme in `RawResourceDataSource` ([#7866](https://github.com/google/ExoPlayer/issues/7866)). diff --git a/demos/main/build.gradle b/demos/main/build.gradle index 716b3c1f998..c5554993dcf 100644 --- a/demos/main/build.gradle +++ b/demos/main/build.gradle @@ -70,13 +70,6 @@ dependencies { implementation 'androidx.appcompat:appcompat:' + androidxAppCompatVersion implementation 'androidx.multidex:multidex:' + androidxMultidexVersion implementation 'com.google.android.material:material:1.2.1' - implementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } implementation project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-dash') implementation project(modulePrefix + 'library-hls') diff --git a/extensions/cronet/build.gradle b/extensions/cronet/build.gradle index 0dd1d42d724..c0f443d5df7 100644 --- a/extensions/cronet/build.gradle +++ b/extensions/cronet/build.gradle @@ -17,13 +17,6 @@ dependencies { api "com.google.android.gms:play-services-cronet:17.0.0" implementation project(modulePrefix + 'library-core') implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion - implementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion testImplementation project(modulePrefix + 'library') diff --git a/extensions/ima/build.gradle b/extensions/ima/build.gradle index f7b2b3f77c0..e2afe7fa51d 100644 --- a/extensions/ima/build.gradle +++ b/extensions/ima/build.gradle @@ -29,35 +29,14 @@ dependencies { implementation project(modulePrefix + 'library-core') implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0' - implementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion androidTestImplementation project(modulePrefix + 'testutils') androidTestImplementation 'androidx.multidex:multidex:' + androidxMultidexVersion androidTestImplementation 'androidx.test:rules:' + androidxTestRulesVersion androidTestImplementation 'androidx.test:runner:' + androidxTestRunnerVersion - androidTestImplementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } androidTestCompileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion testImplementation project(modulePrefix + 'testutils') - testImplementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } testImplementation 'org.robolectric:robolectric:' + robolectricVersion } diff --git a/extensions/media2/build.gradle b/extensions/media2/build.gradle index 744d79980b2..bdafee55585 100644 --- a/extensions/media2/build.gradle +++ b/extensions/media2/build.gradle @@ -19,13 +19,6 @@ dependencies { implementation project(modulePrefix + 'library-core') implementation 'androidx.collection:collection:' + androidxCollectionVersion implementation 'androidx.concurrent:concurrent-futures:1.1.0' - implementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } api 'androidx.media2:media2-session:1.0.3' compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion diff --git a/extensions/okhttp/build.gradle b/extensions/okhttp/build.gradle index f16e382aa1b..032fb0fded2 100644 --- a/extensions/okhttp/build.gradle +++ b/extensions/okhttp/build.gradle @@ -16,13 +16,6 @@ apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { implementation project(modulePrefix + 'library-core') implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion - implementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion testImplementation project(modulePrefix + 'testutils') diff --git a/extensions/workmanager/build.gradle b/extensions/workmanager/build.gradle index 1882ebac81f..b3624e75dc0 100644 --- a/extensions/workmanager/build.gradle +++ b/extensions/workmanager/build.gradle @@ -18,16 +18,6 @@ apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { implementation project(modulePrefix + 'library-core') implementation 'androidx.work:work-runtime:2.4.0' - // Guava & Gradle interact badly, and this prevents - // "cannot access ListenableFuture" errors [internal b/157225611]. - // More info: https://blog.gradle.org/guava - implementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion } diff --git a/library/common/build.gradle b/library/common/build.gradle index 2888b7e24c5..de0df42506d 100644 --- a/library/common/build.gradle +++ b/library/common/build.gradle @@ -16,14 +16,16 @@ apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android.buildTypes.debug.testCoverageEnabled true dependencies { - implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion - implementation ('com.google.guava:guava:' + guavaVersion) { + api ('com.google.guava:guava:' + guavaVersion) { + // Exclude dependencies that are only used by Guava at compile time + // (but declared as runtime deps) [internal b/168188131]. exclude group: 'com.google.code.findbugs', module: 'jsr305' exclude group: 'org.checkerframework', module: 'checker-compat-qual' exclude group: 'com.google.errorprone', module: 'error_prone_annotations' exclude group: 'com.google.j2objc', module: 'j2objc-annotations' exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' } + implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion compileOnly 'com.google.code.findbugs:jsr305:' + jsr305Version compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion diff --git a/library/core/build.gradle b/library/core/build.gradle index 45c8e785c62..ae8e7b773f9 100644 --- a/library/core/build.gradle +++ b/library/core/build.gradle @@ -37,37 +37,16 @@ dependencies { api project(modulePrefix + 'library-common') api project(modulePrefix + 'library-extractor') implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion - implementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } compileOnly 'com.google.code.findbugs:jsr305:' + jsr305Version compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion androidTestImplementation 'androidx.test:runner:' + androidxTestRunnerVersion - androidTestImplementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } androidTestImplementation 'com.linkedin.dexmaker:dexmaker:' + dexmakerVersion androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito:' + dexmakerVersion androidTestImplementation(project(modulePrefix + 'testutils')) { exclude module: modulePrefix.substring(1) + 'library-core' } - testImplementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } testImplementation 'com.squareup.okhttp3:mockwebserver:' + mockWebServerVersion testImplementation 'org.robolectric:robolectric:' + robolectricVersion testImplementation project(modulePrefix + 'testutils') diff --git a/library/dash/build.gradle b/library/dash/build.gradle index e34ab3f9db2..dd1a939fb71 100644 --- a/library/dash/build.gradle +++ b/library/dash/build.gradle @@ -25,13 +25,6 @@ android { dependencies { implementation project(modulePrefix + 'library-core') - implementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion diff --git a/library/extractor/build.gradle b/library/extractor/build.gradle index 82c2309c5ff..e7f20051cd7 100644 --- a/library/extractor/build.gradle +++ b/library/extractor/build.gradle @@ -26,13 +26,6 @@ android { dependencies { implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion implementation project(modulePrefix + 'library-common') - implementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion diff --git a/library/hls/build.gradle b/library/hls/build.gradle index df3b6d35866..2cc91a5105b 100644 --- a/library/hls/build.gradle +++ b/library/hls/build.gradle @@ -25,13 +25,6 @@ android { dependencies { implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion - implementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion diff --git a/library/ui/build.gradle b/library/ui/build.gradle index f63e55b3b3d..81e1e5e1264 100644 --- a/library/ui/build.gradle +++ b/library/ui/build.gradle @@ -20,13 +20,6 @@ dependencies { api 'androidx.media:media:' + androidxMediaVersion implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion implementation 'androidx.recyclerview:recyclerview:' + androidxRecyclerViewVersion - implementation ('com.google.guava:guava:' + guavaVersion) { - exclude group: 'com.google.code.findbugs', module: 'jsr305' - exclude group: 'org.checkerframework', module: 'checker-compat-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.j2objc', module: 'j2objc-annotations' - exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' - } compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion testImplementation project(modulePrefix + 'testutils')