Skip to content

Commit

Permalink
Enfore minCompileSdk version when depending on ExoPlayer/Media3 libs
Browse files Browse the repository at this point in the history
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: #10684
PiperOrigin-RevId: 485100067
(cherry picked from commit 23d39ca)
  • Loading branch information
tonihei authored and microkatz committed Oct 31, 2022
1 parent 721487a commit e4d77f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common_library_config.gradle
Expand Up @@ -22,6 +22,9 @@ android {
targetSdkVersion project.ext.targetSdkVersion
consumerProguardFiles 'proguard-rules.txt'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
aarMetadata {
minCompileSdk = project.ext.compileSdkVersion
}
}

compileOptions {
Expand Down

0 comments on commit e4d77f7

Please sign in to comment.