0

Heres our code:

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

It results in error:

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.

Thank you!

lotor
  • 1,060
  • 7
  • 18
  • this is because you should keep the file name as `build.common.gradle` and not build.gradle as you have written apply from: `'../build.common.gradle'` by default gradle takes build.gradle to refer all its configuration – SHASHI SHEKHAR Barnwal Oct 13 '19 at 06:29

1 Answers1

2

The implementation configuration is also created by java plugin. So you will have to apply that plugin to be able to use that configuration. If you are applying the plugin from the build.common.gradle build file, move the line that references that to above the dependencies block so the plugin gets applied before you attempt to use the things it provides.

If you are doing this already, it could also be happening if you are on an older version of Gradle. Ensure that you are on Gradle 3.4 or later (or you have to use compile instead).

Bjørn Vester
  • 6,851
  • 1
  • 20
  • 20