From 3a21df7775b196d60ac3cd3b91b014c6260aaa0d Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 16 Jun 2026 17:49:41 -0400 Subject: [PATCH] fix(desktop): exclude leaked kotlinx-coroutines-test from release dmg composemediaplayer 0.10.0 publishes kotlinx-coroutines-test as a runtime dependency in its POM. That jar ships a META-INF/services registration for kotlinx.coroutines.CoroutineExceptionHandler -> ExceptionCollectorAsService. The release-only ProGuard pass strips the unreferenced provider class but keeps the services manifest, so the packaged dmg crashed at startup with a ServiceConfigurationError the first time the coroutine exception handler loaded (DesktopHttpClient.). Dev runs were unaffected since they don't run ProGuard. Exclude the test-only artifact so it never lands on the production classpath. Verified: rebuilt release dmg no longer bundles the jar and launches clean. Co-Authored-By: Claude Opus 4.8 (1M context) --- desktopApp/build.gradle.kts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/desktopApp/build.gradle.kts b/desktopApp/build.gradle.kts index a3ab990308..730ab5c59f 100644 --- a/desktopApp/build.gradle.kts +++ b/desktopApp/build.gradle.kts @@ -56,7 +56,16 @@ dependencies { implementation(libs.coil.svg) // Video / audio playback — MIT, OS-native backends (MF / AVFoundation / GStreamer) - implementation(libs.composemediaplayer) + // composemediaplayer 0.10.0 leaks kotlinx-coroutines-test as a *runtime* dependency + // in its published POM. That jar ships a META-INF/services registration for + // kotlinx.coroutines.CoroutineExceptionHandler -> ExceptionCollectorAsService; the + // release ProGuard pass strips the (unreferenced) provider class but keeps the + // services file, so the packaged dmg crashes at startup with a + // ServiceConfigurationError the first time the coroutine exception handler loads. + // It is test-only code that must never be on the production classpath — exclude it. + implementation(libs.composemediaplayer) { + exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-test") + } // Thumbnail extraction — JCodec (pure-Java H.264). LGPL FFmpeg subprocess // for non-H.264 / HLS fallback is invoked via plain ProcessBuilder; no