Dagger 2.2 to 2.3 (or 2.4)
See original GitHub issueI have updated my Dagger version from 2.2 to 2.3 and now facing following problem:
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSetMultimap$Builder.putAll(Ljava/lang/Iterable;)Lcom/google/common/collect/ImmutableSetMultimap$Builder;
Issue Analytics
- State:
- Created 7 years ago
- Comments:48
Top Results From Across the Web
Using Dagger 2 for dependency injection in ... - Vogella.com
Dagger 2 is dependency injection framework. It is based on the Java Specification Request (JSR) 330. It uses code generation and is based...
Read more >dagger 2.0 javadoc (com.google.dagger)
This package contains the public API for the Dagger 2 dependency injection framework. By building upon JSR 330, Dagger 2 provides an annotation-driven...
Read more >Dagger 2
Dagger is a fully static, compile-time dependency injection framework for both Java and Android. It is developed by the Java Core Libraries Team...
Read more >Android MVP with Java, RxJava, Retrofit 2 and Dagger 2 For ...
Design Architecture has been around for a while now, and in this post I will try to explain how to use Dagger 2,...
Read more >NoClassDefFoundError When Using Dagger 2 After Switching ...
try to add class path "com.google.dagger:dagger:2.4" to the main project's build.gradle. NOTE: keep version number same as moudule's build.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like I was right then: add
apt 'com.google.guava:guava:19.0'
just abovedagger-compiler
and it now compiles without error.Before:
After:
As you can see, we now have Guava 19.0 before dagger-compiler, so we’ll use
com.google.common.collect.ImmutableSetMultimap
from Guava 19.0 rather than from dagger-compiler (which is actually Guava 18.0)Dagger 2.4 has been released and should have this issue fixed, so if you added the
apt 'com.google.guava:guava:19.0'
you should be able to remove it now.