Why o why am I getting circular dependency issues?...
# gradle
a
Why o why am I getting circular dependency issues? See thread for details.
Copy code
// <root>/settings.gradle.kts
pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
        maven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
    }
}

include(
    ":libraries:ui", 
    ":features:canvas:compose:ui",
)
Copy code
// libraries/ui/build.gradle.kts
plugins {
    kotlin("multiplatform")
}

kotlin {
    js(IR) {
        browser()
    }

    jvm()

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(libs.jetbrains.compose.ui.geometry)
                implementation(libs.jetbrains.coroutines.core)
            }
        }
    }
}
Copy code
// features/canvas/compose/ui/build.gradle.kts
plugins {
    kotlin("multiplatform")
}

kotlin {
    js(IR) {
        browser()
    }

    jvm()

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(project(":libraries:ui"))
            }
        }
    }
}
This will not build because of:
Copy code
Circular dependency between the following tasks:
:features:canvas:compose:ui:jsPackageJson
\--- :features:canvas:compose:ui:jsPackageJson (*)
a
https://github.com/gradle/gradle/issues/847 Gradle doesn’t like it when multiple subprojects have the same GAV coordinates. You have two subprojects named
ui
. Either rename the subprojects, or try setting the group to be distinct in each subproject
a
Ah… that makes sense. Wow. Too bad the error reporting is so unclear in this case. Thanks!
a
yeah, I don’t mind the restriction, but a helpful warning message is really needed