0

I have created a module named dependencies where I have put all depConstraints I need so I don't have to implement the dependency in each module individually.

I have added Hilt dependencies in my depConstraints'sgradle file but when I want to use Hilt in another module I get the following error

Hilt Android Gradle plugin is applied but no com.google.dagger:hilt-android dependency was found.

Is there a way to use the depConstraints module's dependencies in my other modules (for example app module) without implementing them individually in each module's scope?

1 Answer 1

1

This error may not mean what it says. It pops up when anything with gradle files is wrong and obscures the real error.

Try to comment out hilt plugin import and hilt block (if exists) inside build.gradle file, then Sync Project with Gradle files - most of the time there will be another error.

I spent so much time thinking hilt was the issue, but actually it never was.

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

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.