From d740c0a75ae92abc3f78d41c99b8a30da25a84d9 Mon Sep 17 00:00:00 2001 From: Adrian Niculescu <15037449+adrian-niculescu@users.noreply.github.com> Date: Wed, 16 Sep 2026 14:06:24 +0300 Subject: [PATCH 1/2] Fixed release publishing failing to build the javadoc jar AGP generates the published javadoc with Dokka 1.4.32, which cannot read the sealed classes in livekit-uniffi-android and fails with "PermittedSubclasses requires ASM9". Disabled AGP's javadoc generation and packaged the javadoc jar from the project's Dokka 1.9.20 dokkaJavadoc task instead. --- livekit-android-sdk/build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/livekit-android-sdk/build.gradle b/livekit-android-sdk/build.gradle index b86ece0a..276be3db 100644 --- a/livekit-android-sdk/build.gradle +++ b/livekit-android-sdk/build.gradle @@ -113,6 +113,16 @@ dokkaHtml { } } +// AGP generates the published javadoc with Dokka 1.4.32, which fails to read the sealed classes +// in livekit-uniffi-android ("PermittedSubclasses requires ASM9"). Package the javadoc jar from +// this project's Dokka instead. +tasks.withType(com.android.build.gradle.tasks.JavaDocGenerationTask).configureEach { + enabled = false +} +tasks.withType(com.android.build.gradle.tasks.JavaDocJarTask).configureEach { + from(tasks.named("dokkaJavadoc")) +} + dependencies { //api fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" From 03f6e548ee89a4753a3c2839bcd42d1304d49ce5 Mon Sep 17 00:00:00 2001 From: Adrian Niculescu <15037449+adrian-niculescu@users.noreply.github.com> Date: Wed, 16 Sep 2026 14:40:21 +0300 Subject: [PATCH 2/2] Generated the javadoc into AGP's output directory instead of appending to the jar Disabling AGP's javadoc generation left any output from an earlier build in place, and the jar, which fails on duplicate files, then packaged it next to the Dokka output. The generation task now syncs the Dokka output into its own output directory, so the jar keeps its single input and stale files are removed. --- livekit-android-sdk/build.gradle | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/livekit-android-sdk/build.gradle b/livekit-android-sdk/build.gradle index 276be3db..592f05dd 100644 --- a/livekit-android-sdk/build.gradle +++ b/livekit-android-sdk/build.gradle @@ -113,14 +113,25 @@ dokkaHtml { } } -// AGP generates the published javadoc with Dokka 1.4.32, which fails to read the sealed classes -// in livekit-uniffi-android ("PermittedSubclasses requires ASM9"). Package the javadoc jar from -// this project's Dokka instead. -tasks.withType(com.android.build.gradle.tasks.JavaDocGenerationTask).configureEach { - enabled = false +interface InjectedFileSystemOperations { + @javax.inject.Inject + FileSystemOperations getFs() } -tasks.withType(com.android.build.gradle.tasks.JavaDocJarTask).configureEach { - from(tasks.named("dokkaJavadoc")) + +// AGP generates the published javadoc with Dokka 1.4.32, which fails to read the sealed classes +// in livekit-uniffi-android ("PermittedSubclasses requires ASM9"). The generation task fills its +// output directory from this project's Dokka instead, and the javadoc jar packages that directory. +tasks.withType(com.android.build.gradle.tasks.JavaDocGenerationTask).configureEach { task -> + def fs = objects.newInstance(InjectedFileSystemOperations).fs + def dokkaJavadocOutput = files(tasks.named("dokkaJavadoc")) + task.inputs.files(dokkaJavadocOutput) + task.actions.clear() + task.doLast { generationTask -> + fs.sync { + from(dokkaJavadocOutput) + into(generationTask.outputDirectory) + } + } } dependencies {