dokkaHtmlMultiModule does not working when project has android module
Thanks for the cool documentation tools!
Describe the bug With the android module, the dokkaHtmlMultiModule task succeeds, but the documentation is empty.
Expected behaviour The document is generated.
To Reproduce
You can check run forked Android0GradleIntegrationTest https://github.com/Kotlin/dokka/compare/master...takahirom:can-not-dokkaHtmlMultiModule?expand=1
Project module structure.
root
┗ app
Dokka configuration Mostly similar to the one used in integration tests. https://github.com/Kotlin/dokka/compare/master...takahirom:can-not-dokkaHtmlMultiModule?expand=1
Installation
-
Operating system: macOS
-
Build tool:

-
Dokka version: 1.4.30
Additional context It is not generated by dokkaHtmlMultiModule, but it seems that dokkaHtml in the module does not work if the plugin is applied in the root project. The above will not be reproduced if the plugin is not adapted in the root project. https://github.com/Kotlin/dokka/commit/b8cca436ea04add6d08b65cffbd9fcb161daa3f8
Probably this issue is related to https://github.com/Kotlin/dokka/issues/1463
Hi, thanks for the report. From looking at your branch it appears you removed the Kotlin and Android plugins from the root project, and only applied them to the subproject.
https://github.com/Kotlin/dokka/compare/master...takahirom:dokka:can-not-dokkaHtmlMultiModule
Unfortunately, this means the buildscript classpath across the project is inconsistent. Dokka will be unable to access classes in the Kotlin and Android plugin. This is a Gradle issue that Dokka Gradle plugin cannot influence.
There are a few ways to work around this:
- Apply all plugins in the root plugin, with
apply false. - Use a convention plugin project, and add the plugins as dependencies https://docs.gradle.org/8.14/samples/sample_convention_plugins.html#applying_an_external_plugin_in_precompiled_script_plugin
- Define the plugins in
settings.gradle.ktshttps://docs.gradle.org/8.14/userguide/plugins.html#sec:plugin_management
If there's anything I've missed, please reply with more information. It would help to have the full error message or Gradle log output, and a direct link to the project (or attach a zip to the project.)