在我新创建的 Android 项目中创建新的应用程序模块(“design-kit”)后,我尝试通过将以下内容添加到依赖项来将我的应用程序链接到新模块
implementation project(":design-kit")
但是,该项目
implementation
不会出现错误,而另一个 implementation
的工作原理如下图所示(Android Studio 中显示红色)。
我尝试同步,但出现如下错误
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public val NamedDomainObjectContainer<Configuration>.implementation: NamedDomainObjectProvider<Configuration> defined in org.gradle.kotlin.dsl
我需要做什么才能使
implementation project
在我需要做的项目中有效?
我尝试询问 ChatGPT,但无济于事。
事实证明,我使用的是 build.gradle.kts 文件而不是 build.gradle 文件。
语法应该是
implementation(project(":design-kit"))