错误:找不到方法实现()

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

这里是我们的代码:

dependencies {
    implementation project(path: ':openCVLibrary3')
    implementation project(path: ':DogeCV')
}
apply from: '../build.common.gradle'

导致错误:

ERROR: Could not find method implementation() for arguments [DefaultProjectDependency{dependencyProject='project ':openCVLibrary3'', configuration='default'}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

谢谢!

java gradle implementation
1个回答
0
投票

implementation配置也由java插件创建。因此,您将必须应用该插件才能使用该配置。如果要从build.common.gradle构建文件中应用插件,请将引用该插件的行移到依赖关系块上方,以便在尝试使用插件提供的功能之前先应用插件。

如果您已经在执行此操作,则在使用旧版本的Gradle时可能也会发生。确保您使用的是Gradle 3.4或更高版本(或必须使用compile代替。)>

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