Skip to content

Failed to resolve inter-module dependencies: Cannot change dependencies of dependency configuration #3068

@JesusMcCloud

Description

@JesusMcCloud

Describe the bug
Dokka fails to correctly resolve task dependencies in a multi-module multiplatform project with inter-module dependencies.
This results in a build failure. Note that this is a true multiplatform project with JVM and iOS targets.

The full error message is:

Cannot change dependencies of dependency configuration ':vclib-openid:iosMainImplementationDependenciesMetadata' after task dependencies have been resolved

However, this also happens when manually invoking dokkaHtml for individual modules.

Expected behaviour
Dokka correctly resolves task dependencies of all modules and executes them as required to produce documentation.

To Reproduce

git clone --recursive -b tmp/dokkaFailKGP1.9 git@github.com:a-sit-plus/kmm-vc-library.git
./gradlew dokkaHtmlMultiModule

Dokka configuration
Note: we introduced the the inter-module Dokka-related task dependencies when upgrading to Gradle 8.1, because these dependencies were reported to be implicit and needed to be made explicit for the Dokka tasks to successfully run. The only custom configuration we really depend on is manually setting the output directory of Dokka to reference it for publishing HTML documentation on https://a-sit-plus.github.io/kmm-vc-library/.
(This is also the reason why we manually declared the publishing tasks' dependencies on the signing tasks.)

Note: Removing these manual declarations of Dokka-related task dependencies does not impact the behaviour.

I'm also satisfied with a workaround as a stop-gap solution so we can upgrade to Kotlin 1.9. Everything worked fine with KGP 1.8.20 (Except Gradle 8.1 promoting some warnings to errors compared to Gradle 7.6, requiring the previously mentioned manual specification of task dependencies.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions