plugins { id("com.android.library") id("org.jetbrains.kotlin.android") } android { namespace = "com.soulstream.mediasession" compileSdk = 36 defaultConfig { minSdk = 26 // the plugin's own R8 keep rules, handed to whatever app links this // module — inert unless that app minifies, which only the release // build type does consumerProguardFiles("consumer-rules.pro") } compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = "1.8" } } dependencies { implementation("androidx.core:core-ktx:1.13.1") // The session, the card, and a notification media3 posts and owns itself. // // 1.10.1 and NOT 1.11.0, which is newer (2026-08-05) and would break this // build: media3-session-1.11.0's POM declares // org.jetbrains.kotlin:kotlin-stdlib:2.2.10 at compile scope, this project // compiles Kotlin with kotlin-gradle-plugin 1.9.25 // (src-tauri/gen/android/build.gradle.kts), and Gradle resolves to the // HIGHEST version — so a 1.9 compiler would be handed Kotlin 2.2 metadata. // Every media3 POM from 1.4.1 through 1.10.1 declares no kotlin-stdlib at // all, and SimpleBasePlayer.java is byte for byte the same file at both // tags, so nothing this plugin uses is newer than what is taken here. // // What rides along: media3-common at COMPILE scope, and with it // com.google.guava:guava:33.3.1-android, also compile — that is where // ListenableFuture, Futures and SettableFuture come from, which is why // they are not named on a line of their own — plus // androidx.annotation-experimental, which is androidx.annotation.OptIn. // Then lifecycle-service 2.5.1, because MediaSessionService extends // LifecycleService; media3-datasource, the default BitmapLoader that // decodes the cover; and androidx.media:media:1.7.0 itself, still, at // RUNTIME scope. The deprecated library has not left the APK and cannot — // media3 uses its MediaBrowserServiceCompat. What changed is that none of // OUR code compiles against it any more. // // media3 1.10.1's own minSdk is 23; this module's is 26. Guava adds about // 2.8 MB of unminified classes to the debug APK, and minSdk 26 means // native multidex, so there is no multiDexEnabled line to add. implementation("androidx.media3:media3-session:1.10.1") implementation("androidx.media3:media3-common:1.10.1") implementation(project(":tauri-android")) }