-
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
Dagger 2.2 to 2.3 (or 2.4) #356
Comments
Yes, GreenRobot's EventBus |
I have the same problem, it appeared after upgrading to Dagger 2.3. My only other annotation processor is ButterKnife. Stack trace:
|
It looks like you guys need Guava 19. I'm not sure why it's grabbing an older version, but it should be a safe swap from a previous version to a newer one as long as the other one you're using isn't really old. |
Could it be a conflict with the Guava that's bundled into dagger-compiler.jar due to google-java-format? This means that dagger-compiler contains Guava 18 but depends on Guava 19, and if you don't depend yourself on Guava, or if you declared your Guava dependency later in your POM or Gradle build, then you could have dagger-compiler before Guava in the classpath, resulting in Guava 18 (as bundled into dagger-compiler) shadowing Guava 19. Reordering dependencies might help then until we fix #228 (I should have some time this week-end to finish it) |
I've created sample project showing the error: https://github.com/PavelSynek/dagger-error. There are no other dependencies than AppCompat and Dagger, the build also failed on Travis. |
Looks like I was right then: add Before:
After:
As you can see, we now have Guava 19.0 before dagger-compiler, so we'll use |
adding |
Dagger 2.4 has been released and should have this issue fixed, so if you added the |
@ronshapiro Thanks for the prompt action. |
@ronshapiro I tried removing the guava dependency and same error occured which I mentioned in my opening comment. |
What does |
+--- com.google.dagger:dagger-compiler:2.4
| +--- com.google.dagger:dagger:2.4
| | \--- javax.inject:javax.inject:1
| +--- com.google.dagger:dagger-producers:2.4
| | +--- com.google.dagger:dagger:2.4 (*)
| | \--- com.google.guava:guava:19.0
| \--- com.google.guava:guava:19.0
...
\--- org.glassfish:javax.annotation:10.0-b28 |
@guiwro Then you shouldn't have the error as |
Yes, 2.4 version works well for me. |
@tbroyer I don't know why but as soon as I remove |
@AlokBansal8 Can you run |
When I don't include |
Are you using Guava anywhere else in your build? On Sat, Apr 23, 2016, 9:49 PM Alok Bansal [email protected] wrote:
|
I'm having the same issue.
Here is a list of tests I have made:
Here is my dependencies in the first case that return the error message
|
Maybe the title of this issue should indicate Dagger 2.4, as in this issue we discuss not only about v2.3 but v2.4 as well? Maybe something like: Dagger 2.2 to 2.3 (or 2.4) |
@tbroyer Sorry for the delay. Test 1
Result for
Result for
Test 2
Result for
Result for
Test 3
Result for
Result for
For all tests
|
From my PoV, Dagger 2.4 is OK, but |
@tbroyer So what can be the solution? Can you please list it somewhere so it can be corrected or point me in that direction? |
Based on findings by @AlokBansal8 , test 3 worked, but, proguard build fails. It starts spewing out errors like I read somewhere that I don't need to add any proguard rules for Dagger. Tried with Guess I am going back to Android Studio 1.5.1. |
Using new Jack toolchain along with
This error was persistent, despite using Result for
Important thing to note is note is that earlier problem was with |
Seems related to that previous error that the gradle plugin had an old version of guava. Try adding |
The new configuration for Jack is With that said, |
sorry, use |
@ronshapiro I already tried |
Using |
@AlokBansal8 same experience. Working with same config, not working with annotationProcessor. |
@williamwebb You can see here that annotationProcessor generates files in |
@AlokBansal8 thanks! I am however still running into the |
@williamwebb try adding |
@williamwebb Although I am not getting any error on Android Studio but I getting same error as yours on Circle CI. However, I fixed it with our old |
Worked for me finally. I don't know if it'll work for others:
Classpath:
No errors on either release build or debug build. |
OT: where this |
@carlonzo He is manually specifying the databinding version to use. Normally it is the same version as the android gradle plugin used, unless overwritten like here. |
I also have
Fixes:
In case it would be helpful:
|
You're using Dagger 2.1 not 2.5. |
@JakeWharton yes, this output from dagger Following is real output with dagger 2.5:
|
Guys using gradle |
@AlokBansal8 thanks for the info. I will try to check my project with gradle |
For me it seems that: Data Binding enabled Dagger 2.2 with Gradle 2.1.2 OK. |
2.02 didn't play nicely with the 2.1 version of Gradle. 2.4 doesn't work out of the box either, but at least it plays nicer once I add Guava 19 to the APT task. google/dagger#356
I 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;
The text was updated successfully, but these errors were encountered: