Hey guys! I'm having issues related to javadoc tas...
# dokka
r
Hey guys! I'm having issues related to javadoc task while trying to publish my library. Seems related with jdk and sealed classes / interfaces, but I'm really not sure how to tackle it. I'm using JDK 17, AGP 8.0.2 and Gradle 8.1. Sorry if this is not the best place to ask 😅 Here's the error I'm getting:
Copy code
> Task :moduleX:javaDocReleaseGeneration
Initializing plugins
Dokka is performing: documentation for :moduleX
Validity check
Creating documentation models

WARN: Could not read file: /some/path/build/intermediates/compile_library_classes_jar/release/classes.jar!/some/path/SomeSealedClass.class; size in bytes: 1011; file type: CLASS
java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9
i
Hey! It's interesting that you're the second person to report such a problem (first report here), and both of you are using a task called
javaDocReleaseGeneration
🙂 Where does it actually come from, is it from AGP? If it's from AGP, the task is likely using the version of Dokka that is bundled in AGP (and this version is likely very old, so it doesn't support Java 17+). I left a more detailed explanation here: https://github.com/Kotlin/dokka/issues/2956#issuecomment-1522451063
r
Where does it actually come from, is it from AGP?
I’m not sure.. but I was running a task that publishes the library to maven central. How can I check where this subtask comes from? Also is there a way to force a specific version of dokka?
Im guessing if I explicitly add dokka then agp will use that instead of the one bundled? 🤔
Sorry for my lack of knowledge in this 😅
i
Yeah, no worries, I'm also confused 😁 If you explicitly add Dokka and use Dokka's tasks then yes, it should work fine, as long as Dokka's Gradle plugin doesn't get in the way with Gradle 8. There's some (non-idiomatic) documentation here: https://kotlinlang.org/docs/dokka-gradle.html
r
In case someone else finds this thread with similar issue: Turns out it was a misunderstanding from AGP 8.0+. I thought it required the project to use java 17 all around, but it only requires the IDE gradle settings to target java 17, every module can still target java 1.8. For some reason this issue comes up when I tried moving every module to target java 17 as well.
I left this alone until today where I really wanted to test something else. Then I checked what other people are doing and realised I didn't need to target java 17 because of AGP (which looking back wouldn't make much sense 🤦‍♂️ ).
141 Views