-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.NoClassDefFoundError: Failed resolution of: dagger/internal/Preconditions #403
Comments
Can you post all versions of dagger that you use in your codebase? both |
Sure, @ronshapiro, I use both apt "com.google.dagger:dagger-compiler:2.4" |
This is almost definitely a gradle/android toolchain issue, not a dagger one. A probable workaround is to add |
Thanks @ronshapiro, now that you mention I remembered that aars do not import dependencies and therefore dagger is not imported, sorry about this. |
@luispereira please let me know how you resolved this issue. I got the same error but i can find a work around. i will really appreciate. |
Hi @andronicus-kim, the problem here is that So in your main project, I had to do something like this:
|
@luispereira Thanks a lot for your response, by main project you mean importing my dependencies to project level build.gradle ? |
Hi @luispereira for more clarity, i encountered this error in my app not a library, i'm not sure if that will make a difference |
@andronicus-kim, the example I shared was the import of the aar. on your project, if you use dagger dependency on your .aar project you need to use also on the project that you import the .aar or simply do |
@luispereira Thanks a lot. |
This doesn't make any sense to me. Why does the consumer of a dependency need to also import the dependencies of the dependency? |
I'm using dagger on a library project and everything foes well on the sample app with the lib project. Altough, when I try to import the generated aar for the library the follow error happens in runtime when I run the application and the method pointing to the dagger injection on the library is called:
I'm only using the following dependencies on the app:
Also I'm Using release 2.4. of dagger
And I believe it is not a multidex issue :/
The text was updated successfully, but these errors were encountered: