Skip to content

KMP: Multiple pages associated with key occurs when there are both actual and non-actual declarations with the same name #4311

@vmishenev

Description

@vmishenev

I am getting this error as well with my library, Kotbase. Set dokka = 2.1.0 in libs.versions.toml and run ./gradlew dokkaGenerate:

Full Gradle output
w: [:couchbase-lite:dokkaGenerateModuleHtml] Couldn't resolve link for init in CouchbaseLite.jvm.kt/kotbase.internalInit
w: [:couchbase-lite-ee:dokkaGenerateModuleHtml] Couldn't resolve link for init in CouchbaseLite.jvm.kt/kotbase.internalInit

Task :couchbase-lite-ktx:logLinkDokkaGeneratePublicationHtml
Generated Dokka HTML publication: http://localhost:63342/kotbase/couchbase-lite-ktx/build/dokka/html/index.html

Task :couchbase-lite-kermit:logLinkDokkaGeneratePublicationHtml
Generated Dokka HTML publication: http://localhost:63342/kotbase/couchbase-lite-kermit/build/dokka/html/index.html

Task :couchbase-lite-paging:logLinkDokkaGeneratePublicationHtml
Generated Dokka HTML publication: http://localhost:63342/kotbase/couchbase-lite-paging/build/dokka/html/index.html
w: [:couchbase-lite:dokkaGeneratePublicationHtml] Couldn't resolve link for init in CouchbaseLite.jvm.kt/kotbase.internalInit

Task :couchbase-lite:dokkaGenerateModuleHtml FAILED
w: [:couchbase-lite-ee:dokkaGeneratePublicationHtml] Couldn't resolve link for init in CouchbaseLite.jvm.kt/kotbase.internalInit
Task :couchbase-lite-ee:dokkaGenerateModuleHtml FAILED
Task :couchbase-lite:dokkaGeneratePublicationHtml FAILED

Task :couchbase-lite:logLinkDokkaGeneratePublicationHtml
Generated Dokka HTML publication: http://localhost:63342/kotbase/couchbase-lite/build/dokka/html/index.html

Task :couchbase-lite-ee-kermit:logLinkDokkaGeneratePublicationHtml
Generated Dokka HTML publication: http://localhost:63342/kotbase/couchbase-lite-ee-kermit/build/dokka/html/index.html

Task :couchbase-lite-ee-paging:logLinkDokkaGeneratePublicationHtml
Generated Dokka HTML publication: http://localhost:63342/kotbase/couchbase-lite-ee-paging/build/dokka/html/index.html

Task :couchbase-lite-ee-ktx:logLinkDokkaGeneratePublicationHtml
Generated Dokka HTML publication: http://localhost:63342/kotbase/couchbase-lite-ee-ktx/build/dokka/html/index.html

Task :couchbase-lite-ee:dokkaGeneratePublicationHtml FAILED

Task :couchbase-lite-ee:logLinkDokkaGeneratePublicationHtml
Generated Dokka HTML publication: http://localhost:63342/kotbase/couchbase-lite-ee/build/dokka/html/index.html

[Incubating] Problems report is available at: file:///Users/jeff/Documents/GitHub/kotbase/build/reports/problems/problems-report.html

FAILURE: Build completed with 4 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':couchbase-lite:dokkaGenerateModuleHtml'.
A failure occurred while executing org.jetbrains.dokka.gradle.workers.DokkaGeneratorWorker
   > Multiple pages associated with key: kotbase/Collection/indexes/#/PointingToDeclaration//[DisplaySourceSet(sourceSetIDs=CompositeSourceSetID(children=[:couchbase-lite/appleMain]), name=apple, platform=common)]

* Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to generate a Build Scan (Powered by Develocity).
Get more help at https://help.gradle.org.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':couchbase-lite-ee:dokkaGenerateModuleHtml'.
A failure occurred while executing org.jetbrains.dokka.gradle.workers.DokkaGeneratorWorker
   > Multiple pages associated with key: kotbase/Collection/indexes/#/PointingToDeclaration//[DisplaySourceSet(sourceSetIDs=CompositeSourceSetID(children=[:couchbase-lite-ee/appleMain]), name=apple, platform=common)]

* Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to generate a Build Scan (Powered by Develocity).
Get more help at https://help.gradle.org.
==============================================================================

3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':couchbase-lite:dokkaGeneratePublicationHtml'.
A failure occurred while executing org.jetbrains.dokka.gradle.workers.DokkaGeneratorWorker
   > Multiple pages associated with key: kotbase/Collection/indexes/#/PointingToDeclaration//[DisplaySourceSet(sourceSetIDs=CompositeSourceSetID(children=[:couchbase-lite/appleMain]), name=apple, platform=common)]

* Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to generate a Build Scan (Powered by Develocity).
Get more help at https://help.gradle.org.
==============================================================================

4: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':couchbase-lite-ee:dokkaGeneratePublicationHtml'.
A failure occurred while executing org.jetbrains.dokka.gradle.workers.DokkaGeneratorWorker
   > Multiple pages associated with key: kotbase/Collection/indexes/#/PointingToDeclaration//[DisplaySourceSet(sourceSetIDs=CompositeSourceSetID(children=[:couchbase-lite-ee/appleMain]), name=apple, platform=common)]

* Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to generate a Build Scan (Powered by Develocity).
Get more help at https://help.gradle.org.
==============================================================================

Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/9.1.0/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 1m 8s
307 actionable tasks: 156 executed, 151 up-to-date

It might have something to do with the fact that much of the API between the couchbase-lite and couchbase-lite-ee modules is the same. The same applies for the other three modules, where there's a CE and EE edition of each.

Originally posted by @jeffdgr8 in #4300


couchbase-lite has two similar declarations actual val indexes and fun index() here that cause the exception

Multiple pages associated with key: kotbase/Collection/indexes/#/PointingToDeclaration//[DisplaySourceSet(sourceSetIDs=CompositeSourceSetID(children=[:couchbase-lite-ee/appleMain]), name=apple, platform=common)]

It was broken in Dokka 2.1.0 after the fix #4016

Metadata

Metadata

Assignees

Labels

bugtopic: K2Issues / PRs that are related to the K2 migration. See #2888

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions