代码之家  ›  专栏  ›  技术社区  ›  Yousef

KMM:无法从另一个模块引用共享模块commonMain源集类

  •  0
  • Yousef  · 技术社区  · 3 年前

    我在模块中包含了一个要引用的共享模型,但我似乎无法导入它

    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
    

    它提供了添加我已经添加的相同依赖性。

    enter image description here

    enter image description here

    0 回复  |  直到 3 年前
        1
  •  0
  •   Yousef    3 年前

    必须将build.grade中的backendMain文件夹和jvm(“backend”)添加到共享模块