From 23d39caea0bee0143705191fd97ac7f0cf9a76f9 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 --- common_library_config.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common_library_config.gradle b/common_library_config.gradle index 51773ca0e18..002502299b1 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 {