https://kotlinlang.org logo
#dokka
Title
a

atsushieno

10/11/2022, 3:39 AM
Hi, I am currently stuck at this https://stackoverflow.com/questions/71998578/execution-failed-for-task-appdokkahtml in my project (like this https://github.com/atsushieno/ktmidi/actions/runs/3220797604/jobs/5267956067#step:9:11495). None of the workarounds written there (removing those auto-generated targets) worked for me. Is it a known issue?
1
i

Ignat Beresnev

10/11/2022, 12:07 PM
Hi! I think it's a configuration problem. You've applied Dokka only to
ktmidi
module, but it's not present in the parent
build.gradle
script. I would start with that and see if it works
Copy code
Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.gradle b/build.gradle
--- a/build.gradle	(revision 079e433a8f9fcee06f85f2291a1ec0c52d77f342)
+++ b/build.gradle	(date 1665489875417)
@@ -2,6 +2,7 @@
     id "org.jetbrains.kotlin.multiplatform" version "1.7.20" apply false
     id "org.jetbrains.kotlin.jvm" version "1.7.20" apply false
     id "com.android.library" version "7.3.0" apply false
+    id("org.jetbrains.dokka") version "1.7.10"
 }
 
 allprojects {
If Dokka worked before and all of a sudden stopped working, did you upgrade AGP version recently? If so, it might be related to #2472. AGP started shipping unshaded Dokka 1.4 some versions ago, and it's conflicting with newer version of Dokka (such as 1.7). If you run
./gradlew buildEnvironment
in the root project directory you'll actually see that you have Dokka
1.4.32
on the classpath and if you run
./gradlew ktmidi:buildEnvironment
, you'll see that it has Dokka
1.7.10
on the classpath These two are not compatible, so running
./gradlew clean :ktmidi:dokkaHtml --stacktrace
results in this:
Copy code
Caused by: java.lang.NoSuchMethodError: 'java.util.Set org.jetbrains.dokka.DokkaDefaults.getDocumentedVisibilities()'
which is somewhat expected This issue should be resolved in AGP 7.3, I see you're currently using 7.2
TLDR: either upgrade AGP to 7.3 or try adding Dokka to the root build script (can do with
apply = false
), it'll override Dokka 1.4 shipped with AGP with the newer version then.
a

atsushieno

10/11/2022, 12:16 PM
Awesome, those are so informative, thanks. Let me first try your patch. My project structure has changed a lot (they used to be separate "projects") so former versions are not comparable.
Yes, that fix/workaround for #2472 worked. Thanks a lot!
🦜 1