-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AndroidX classes produce Error class: unknown class
in generated HTML
#71
Comments
Thanks for the report, this is something that needs to be fixed. I first encountered this problem in #57. I hoped it would be fixed by #59, but apparently not. I suspect it's an issue with classpath ordering, but I'm not certain. It could also be caused by Dokka trying to merge multiple source sets. I'm not very familiar with Android development, so help would be appreciated. Specifically,
|
So I've just tested adding the Dokka plugin itself to the project (with Output with --info flag
(or with the Output with --dry-run flag
While Dokkatoo ( Output with --info flag
(or with the Output with --dry-run flag
So I guess there's something going on in the partial task that Dokka uses for sub-projects? I presume it's delegating to KGP to compile the Android libraries via AGP, as I've also noticed that the partial task immediately shows what seems to be AGP output right after:
|
Hmm yes, that sounds like a relevant find, good work So Dokka Gradle Plugin fetches the classpath from the This is not ideal because task properties are not really supposed to be used to transfer files, even if it is convenient and produces correct output. Dokkatoo achieves the same result by fetching the classpath via configurations dokkatoo/modules/dokkatoo-plugin/src/main/kotlin/adapters/DokkatooKotlinAdapter.kt Lines 139 to 157 in 06fb1a8
However, maybe this misses some sort of dependency transformation that Android requires... |
I've just added a temporary commit to my Dokka fork (EdricChan03/dokka@f29d209) that adds temporary logging of the Dokka config to disk, and I can confirm that it is transformed 🙃 (prettified a bit, original was all in a single line) "classpath" : [
"<project>/androidx/browser/browser-ktx/build/intermediates/compile_r_class_jar/debug/R.jar",
"<home>/.gradle/caches/transforms-3/<...>/transformed/browser-1.5.0-api.jar",
"<home>/.gradle/caches/transforms-3/<...>/transformed/core-1.1.0-api.jar",
"<home>/.gradle/caches/transforms-3/<...>/transformed/versionedparcelable-1.1.0-api.jar",
"<home>/.gradle/caches/modules-2/files-2.1/androidx.collection/collection/1.1.0/<...>/collection-1.1.0.jar",
"<home>/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.8.21/<...>/kotlin-stdlib-jdk8-1.8.21.jar",
"<home>/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation-jvm/1.6.0/<...>/annotation-jvm-1.6.0.jar",
"<home>/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.8.21/<...>/kotlin-stdlib-jdk7-1.8.21.jar",
"<home>/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.21/kotlin-stdlib-1.8.21.jar",
"<home>/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.21/<...>/kotlin-stdlib-common-1.8.21.jar",
"<home>/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/<...>/annotations-13.0.jar",
"<home>/.gradle/caches/modules-2/files-2.1/com.google.guava/listenablefuture/1.0/<...>/listenablefuture-1.0.jar",
"<home>/.gradle/caches/transforms-3/<...>/transformed/lifecycle-runtime-2.0.0-api.jar",
"<home>/.gradle/caches/modules-2/files-2.1/androidx.lifecycle/lifecycle-common/2.0.0/<...>/lifecycle-common-2.0.0.jar",
"<home>/.gradle/caches/modules-2/files-2.1/androidx.arch.core/core-common/2.0.0/<...>/core-common-2.0.0.jar",
"<home>/Library/Android/sdk/platforms/android-33/android.jar",
"<home>/Library/Android/sdk/build-tools/30.0.3/core-lambda-stubs.jar"
], Let me know if you need additional information/a reproducer |
Until adamko-dev/dokkatoo#71 is fixed, we'll probably have to rollback to plain ol' Dokka
I believe this issue will be fixed by #76. Leave a comment or create a new issue if there's anything to improve with Android projects. |
Yep, I can confirm it was fixed: https://edricchan03.github.io/androidx-ktx-extras |
@EdricChan03 Great to hear! Thanks for the update. |
For whatever reason, AndroidX classes (for e.g.
androidx.browser.customtabs.CustomTabColorSchemeParams
) producesError class: unknown class
in the resulting HTML output:CustomTabColorSchemeParams
also isn't clickable in the generated KDoc.Source code for reference
I'm currently using 1.3.0, but this issue also appears to be present in 1.2.0 from some quick testing.
Checking the
dokka_parameters.json
file does show that theandroidx.browser
artifact is included in the classpath though:Expand to view
dokka_parameters.json
Sources
Additional info
Curiously enough, the annotations seem to work as expected though... 🤔
The text was updated successfully, but these errors were encountered: