模块 Android Studio - 我的 moduleA 无法使用 moduleB 中的类

问题描述 投票:0回答:1

我正在尝试从 moduleA 访问 moduleB,但即使我使用模块设置引用该模块,Android Studio 也只是在每次尝试同步 build.gradle 时添加相同的行。

enter image description here

我有点细节:这两个模块是多平台的。

enter image description here

我尝试清理、重建项目并在 Android Studio 中使用“无效缓存”,但没有解决问题。

是否可以在另一个多平台模块中使用一个多平台模块?

kotlin gradle module kotlin-multiplatform
1个回答
0
投票

要在 Kotlin 多平台项目中导入另一个模块,请在您的

build.gradle.kts
文件中这样编写:

dependencies {
    implementation(project(":data"))
}

(“data”是项目名称。)

© www.soinside.com 2019 - 2024. All rights reserved.