From 136b8c57d9144e6e643856be604a69132ae2c8b0 Mon Sep 17 00:00:00 2001 From: tonihei Date: Mon, 31 Oct 2022 18:13:59 +0000 Subject: [PATCH] Enfore minCompileSdk version when depending on ExoPlayer/Media3 libs If an app sets a compileSdkVersion that is lower than the one used to create AARs of its dependencies, the build process may produce invalid outputs, for example by stripping methods from the APK that are only called when the app is running on a new API version. To avoid this issue, we can enforce that the compileSdk of apps or libraries depending on ExoPlayer/Media3 is at least the same as the one we used for compilation when creating the AAR. Issue: google/ExoPlayer#10684 PiperOrigin-RevId: 485100067 --- RELEASENOTES.md | 2 ++ common_library_config.gradle | 3 +++ 2 files changed, 5 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index d10173ead2..1f08de9bee 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -26,6 +26,8 @@ Release notes * Send missing `onMediaItemTransition` callback when calling `seekToNext` or `seekToPrevious` in a single-item playlist ([#10667](https://github.com/google/ExoPlayer/issues/10667)). + * Enforce minimum `compileSdkVersion` to avoid compilation errors + ([#10684](https://github.com/google/ExoPlayer/issues/10684)). * Downloads: * Fix potential infinite loop in `ProgressiveDownloader` caused by simultaneous download and playback with the same `PriorityTaskManager` diff --git a/common_library_config.gradle b/common_library_config.gradle index 9d14a1f601..a831ddea0b 100644 --- a/common_library_config.gradle +++ b/common_library_config.gradle @@ -22,6 +22,9 @@ android { targetSdkVersion project.ext.targetSdkVersion consumerProguardFiles 'proguard-rules.txt' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' + aarMetadata { + minCompileSdk = project.ext.compileSdkVersion + } } compileOptions {