0

I made a library, but when I tried to use it with implementation 'com.example:mylibrary:1.3.0' in my app's build.gradle, I keep getting an error saying the ConstraintLayout dependency (which the library uses but not the app) is not found. However it was explicitly defined in the library's build.gradle with implementation.

When I ran gradlew app:dependencies on the terminal, it shows that the library has no dependencies, even though it actually has 2. This seems to be the source of the problem, Gradle can't detect the dependencies of the library.

I didn't run into this problem for a while but when I decided to remove the ConstraintLayout dependency from my app an error appears during build.

1 Answer 1

1

When you're using implementation for the dependencies in your library, the project which is dependent with it will not see the dependencies. You need to use api instead of implementation.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, I thought implementation and compile were the same. More info: stackoverflow.com/a/44419574/5288316
Actually this wasn't the problem, it was with the pom file not including the library's dependencies.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.