1

I have a Core project where it has dependencies to other library.

Core build.gradle
    dependencies {
        implementation 'com.jakewharton:butterknife:9.0.0-rc2'
        annotationProcessor  'com.jakewharton:butterknife-compiler:9.0.0-rc2'
    }

And I have other User project that reference to Core. When the User project, does reference to Core library:

User build.gradle
    dependencies {
        implementation 'com.example: core: 1.0'
    }

In User project I can acces at butterknife classes but when I reference at Core project

User build.gradle
    dependecies{
        implementation project(":core")
    }

I can't access to butterknife classes (Compilation failed; see the compiler error output for details.)

Is there any way to reference core and be able to use the dependencies referenced by core?

2
  • Where is the "compiler output for more details"?
    – DallaRosa
    Dec 14, 2018 at 15:39
  • This is the message: "error: cannot find symbol class BindView" Dec 14, 2018 at 15:52

1 Answer 1

2

This is the way implementation configuration works.

The plugin exposes two configurations that can be used to declare dependencies: api and implementation. The api configuration should be used to declare dependencies which are exported by the library API, whereas the implementation configuration should be used to declare dependencies which are internal to the component.

Dependencies appearing in the api configurations will be transitively exposed to consumers of the library, and as such will appear on the compile classpath of consumers. Dependencies found in the implementation configuration will, on the other hand, not be exposed to consumers, and therefore not leak into the consumers' compile classpath.

Either declare Butter Knife as an api dependency, or depend on it explicitly in user/build.gradle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.