Search code examples
kotlingradlekotlin-multiplatform

KMM: Can't reference shared module commonMain source set classes from another module


I have included a shared model to reference in the module, but I can't seem to import it

plugins {
    kotlin("jvm") version "1.8.20"
    kotlin("plugin.allopen") version "1.8.20"
    id("io.quarkus")
}

repositories {
    mavenCentral()
    mavenLocal()
}

val quarkusPlatformGroupId: String by project
val quarkusPlatformArtifactId: String by project
val quarkusPlatformVersion: String by project

dependencies {
    //removing configuration = configurations.default.name causes errors that's why it's there
    implementation(project(path = ":shared", configuration = configurations.default.name)) 
    //...other deps
}

//..other

It offers to add the same dependancy I have already added.

enter image description here

enter image description here


Solution

  • had to add a backendMain folder and jvm("backend") in the build.grade to the shared module