Commit 136b8c57 by tonihei Committed by microkatz

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
parent 6ff980d4
Showing with 5 additions and 0 deletions
...@@ -26,6 +26,8 @@ Release notes ...@@ -26,6 +26,8 @@ Release notes
* Send missing `onMediaItemTransition` callback when calling `seekToNext` * Send missing `onMediaItemTransition` callback when calling `seekToNext`
or `seekToPrevious` in a single-item playlist or `seekToPrevious` in a single-item playlist
([#10667](https://github.com/google/ExoPlayer/issues/10667)). ([#10667](https://github.com/google/ExoPlayer/issues/10667)).
* Enforce minimum `compileSdkVersion` to avoid compilation errors
([#10684](https://github.com/google/ExoPlayer/issues/10684)).
* Downloads: * Downloads:
* Fix potential infinite loop in `ProgressiveDownloader` caused by * Fix potential infinite loop in `ProgressiveDownloader` caused by
simultaneous download and playback with the same `PriorityTaskManager` simultaneous download and playback with the same `PriorityTaskManager`
......
...@@ -22,6 +22,9 @@ android { ...@@ -22,6 +22,9 @@ android {
targetSdkVersion project.ext.targetSdkVersion targetSdkVersion project.ext.targetSdkVersion
consumerProguardFiles 'proguard-rules.txt' consumerProguardFiles 'proguard-rules.txt'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
aarMetadata {
minCompileSdk = project.ext.compileSdkVersion
}
} }
compileOptions { compileOptions {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment