google / dagger

A fast dependency injector for Android and Java.
https://dagger.dev
Apache License 2.0
17.44k stars 2.02k forks source link

Dagger 2.2 to 2.3 (or 2.4) #356

Closed AlokBansal8 closed 8 years ago

AlokBansal8 commented 8 years ago

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;

ronshapiro commented 8 years ago

Are you using any other annotation processors? Looks like #349/#228

AlokBansal8 commented 8 years ago

Yes, GreenRobot's EventBus

PavelSynek commented 8 years ago

I have the same problem, it appeared after upgrading to Dagger 2.3. My only other annotation processor is ButterKnife.

Stack trace:

Caused by: java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSetMultimap$Builder.putAll(Ljava/lang/Iterable;)Lcom/google/common/collect/ImmutableSetMultimap$Builder;
    at dagger.internal.codegen.ResolvedBindings.bindingsByComponent(ResolvedBindings.java:107)
    at dagger.internal.codegen.BindingGraphValidator$Validation.traverseRequest(BindingGraphValidator.java:272)
    at dagger.internal.codegen.BindingGraphValidator$Validation.validateSubgraph(BindingGraphValidator.java:175)
    at dagger.internal.codegen.BindingGraphValidator.validate(BindingGraphValidator.java:1168)
    at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:138)
    at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:46)
    at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:318)
    at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:171)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
    at com.sun.tools.javac.main.Main.compile(Main.java:523)
    ... 90 more
gk5885 commented 8 years ago

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.

tbroyer commented 8 years ago

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)

PavelSynek commented 8 years ago

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.

tbroyer commented 8 years ago

Looks like I was right then: add apt 'com.google.guava:guava:19.0' just above dagger-compiler and it now compiles without error.

Before:

$ ./gradlew app:dependencies --configuration=apt
Incremental java compilation is an incubating feature.
:app:dependencies

------------------------------------------------------------
Project :app
------------------------------------------------------------

apt
+--- com.google.dagger:dagger-compiler:2.3
|    +--- com.google.dagger:dagger:2.3
|    |    \--- javax.inject:javax.inject:1
|    +--- com.google.dagger:dagger-producers:2.3
|    |    +--- com.google.dagger:dagger:2.3 (*)
|    |    \--- com.google.guava:guava:19.0
|    \--- com.google.guava:guava:19.0
+--- com.android.support:appcompat-v7:23.2.0
|    +--- com.android.support:support-v4:23.2.0
|    |    \--- com.android.support:support-annotations:23.2.0
|    +--- com.android.support:animated-vector-drawable:23.2.0
|    |    \--- com.android.support:support-vector-drawable:23.2.0
|    |         \--- com.android.support:support-v4:23.2.0 (*)
|    \--- com.android.support:support-vector-drawable:23.2.0 (*)
+--- com.google.dagger:dagger:2.3 (*)
\--- org.glassfish:javax.annotation:10.0-b28

(*) - dependencies omitted (listed previously)

BUILD SUCCESSFUL

Total time: 0.641 secs

After:

$ ./gradlew app:dependencies --configuration=apt
Incremental java compilation is an incubating feature.
:app:dependencies

------------------------------------------------------------
Project :app
------------------------------------------------------------

apt
+--- com.google.guava:guava:19.0
+--- com.google.dagger:dagger-compiler:2.3
|    +--- com.google.dagger:dagger:2.3
|    |    \--- javax.inject:javax.inject:1
|    +--- com.google.dagger:dagger-producers:2.3
|    |    +--- com.google.dagger:dagger:2.3 (*)
|    |    \--- com.google.guava:guava:19.0
|    \--- com.google.guava:guava:19.0
+--- com.android.support:appcompat-v7:23.2.0
|    +--- com.android.support:support-v4:23.2.0
|    |    \--- com.android.support:support-annotations:23.2.0
|    +--- com.android.support:animated-vector-drawable:23.2.0
|    |    \--- com.android.support:support-vector-drawable:23.2.0
|    |         \--- com.android.support:support-v4:23.2.0 (*)
|    \--- com.android.support:support-vector-drawable:23.2.0 (*)
+--- com.google.dagger:dagger:2.3 (*)
\--- org.glassfish:javax.annotation:10.0-b28

(*) - dependencies omitted (listed previously)

BUILD SUCCESSFUL

Total time: 0.652 secs

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)

AlokBansal8 commented 8 years ago

adding apt 'com.google.guava:guava:19.0' works.

ronshapiro commented 8 years ago

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.

AlokBansal8 commented 8 years ago

@ronshapiro Thanks for the prompt action.

AlokBansal8 commented 8 years ago

@ronshapiro I tried removing the guava dependency and same error occured which I mentioned in my opening comment.

tbroyer commented 8 years ago

What does ./gradlew app:dependencies --configuration=apt prints out now?

ghost commented 8 years ago

@tbroyer

+--- 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
tbroyer commented 8 years ago

@guiwro Then you shouldn't have the error as com.google.dagger:dagger-compiler:2.4 no longer includes Guava classes, so should correctly use the com.google.guava:guava:19.0. @AlokBansal8 can you confirm?

ghost commented 8 years ago

Yes, 2.4 version works well for me.

AlokBansal8 commented 8 years ago

@tbroyer I don't know why but as soon as I remove apt 'com.google.guava:guava:19.0' Following error pops up: 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; I am working on two Android projects and see the similar behaviour in both of them.

tbroyer commented 8 years ago

@AlokBansal8 Can you run ./gradlew app:dependencies --configuration=apt again and report the results here?

solcott commented 8 years ago

When I don't include apt 'com.google.guava:guava:19.0' this happens when I update from using version 2.0.0 of the android gradle plugin to version 2.1.0-rc1. If I revert back to 2.0.0 it goes away.

AlokBansal8 commented 8 years ago

@tbroyer I am travelling hence, it is not possible for me to do what you are asking. Like @solcott I am also using gradle plugin version 2.1.0, 2.1.0-beta3 to be more precise.

ronshapiro commented 8 years ago

Are you using Guava anywhere else in your build?

On Sat, Apr 23, 2016, 9:49 PM Alok Bansal notifications@github.com wrote:

@tbroyer https://github.com/tbroyer I am travelling hence, it is not possible for me to do what you are asking. Like @solcott https://github.com/solcott I am also using gradle plugin version 2.1.0, 2.1.0-beta3 to be more precise.

— You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub https://github.com/google/dagger/issues/356#issuecomment-213864602

4brunu commented 8 years ago

I'm having the same issue.

java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSetMultimap$Builder.putAll(Ljava/lang/Iterable;)Lcom/google/common/collect/ImmutableSetMultimap$Builder;

Here is a list of tests I have made:

Here is my dependencies in the first case that return the error message

------------------------------------------------------------
Project :app
------------------------------------------------------------

apt
+--- 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
+--- project :shared
+--- com.android.support:appcompat-v7:23.3.0
|    +--- com.android.support:support-vector-drawable:23.3.0
|    |    \--- com.android.support:support-v4:23.3.0
|    |         \--- com.android.support:support-annotations:23.3.0
|    +--- com.android.support:animated-vector-drawable:23.3.0
|    |    \--- com.android.support:support-vector-drawable:23.3.0 (*)
|    \--- com.android.support:support-v4:23.3.0 (*)
+--- com.android.support:design:23.3.0
|    +--- com.android.support:appcompat-v7:23.3.0 (*)
|    +--- com.android.support:support-v4:23.3.0 (*)
|    \--- com.android.support:recyclerview-v7:23.3.0
|         +--- com.android.support:support-v4:23.3.0 (*)
|         \--- com.android.support:support-annotations:23.3.0
+--- com.squareup.okhttp3:okhttp:3.2.0
|    \--- com.squareup.okio:okio:1.6.0
+--- io.reactivex:rxjava:1.1.3
+--- io.reactivex:rxandroid:1.1.0
|    \--- io.reactivex:rxjava:1.1.0 -> 1.1.3
+--- com.github.castorflex.smoothprogressbar:library-circular:1.2.0
|    \--- com.android.support:support-annotations:23.0.0 -> 23.3.0
+--- com.google.dagger:dagger:2.4 (*)
+--- javax.annotation:jsr250-api:1.0
+--- com.android.databinding:library:1.1
|    +--- com.android.support:support-v4:21.0.3 -> 23.3.0 (*)
|    \--- com.android.databinding:baseLibrary:1.1 -> 2.1.0
+--- com.android.databinding:baseLibrary:2.1.0
+--- com.android.databinding:adapters:1.1
|    +--- com.android.databinding:library:1.1 (*)
|    \--- com.android.databinding:baseLibrary:1.1 -> 2.1.0
\--- com.android.databinding:compiler:2.1.0
     +--- com.android.databinding:baseLibrary:2.1.0
     \--- com.googlecode.juniversalchardet:juniversalchardet:1.0.3

(*) - dependencies omitted (listed previously)
AlokBansal8 commented 8 years ago

I have also tried with new stable gradle plugin 2.1 and I am getting the same error message.

ndmt commented 8 years ago

Hello,

I have a similar problem with my producers components and the android databinding library with Gradle plugin 2.1

dependencies {
    final SUPPORT_LIBRARY_VERSION = '23.3.0'
    final DAGGER_VERSION = '2.4'

    compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"

    compile "com.google.dagger:dagger:$DAGGER_VERSION"
    compile "com.google.dagger:dagger-producers:$DAGGER_VERSION"

    def daggerCompiler = "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
    apt daggerCompiler
}

It's ok, it's working

But when I add :

...
 dataBinding {
        enabled = true
    }
}

The result is : `Error:Execution failed for task ':app:compileDebugJavaWithJavac'. java.lang.NoSuchMethodError: com.google.common.base.CharMatcher.whitespace()Lcom/google/common/base/CharMatcher;``

So I put the apt 'com.google.guava:guava:19.0' Now I have this issue: Error:(36, 19) error: cannot find symbol method transformAsync(ListenableFuture<Void>,<anonymous AsyncFunction<Void,String>>,Executor)

but, If i put :

 dataBinding {
        enabled = true
        version = "2.0.0"
    }

It's working fine and I can remove apt 'com.google.guava:guava:19.0'

An other test:

...
    dataBinding {
        enabled = true;
    }
}

dependencies {
    final SUPPORT_LIBRARY_VERSION = '23.3.0'
    final DAGGER_VERSION = '2.4'

    compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"

    compile "com.google.dagger:dagger:$DAGGER_VERSION"
    compile "com.google.dagger:dagger-producers:$DAGGER_VERSION"

    def daggerCompiler = "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
    apt daggerCompiler
}

I change Gradle plugin 2.1.0 to 2.0.0 and now it's working fine but I can't use the instant run feature

shoheikawano commented 8 years ago

@AlokBansal8

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)

AlokBansal8 commented 8 years ago

@tbroyer Sorry for the delay.

Test 1

dataBinding {
    enabled = true
  }

Result for $ ./gradlew app:dependencies --configuration=apt

+--- 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

Result for $ ./gradlew installDebug

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;

Test 2

dataBinding {
    enabled = true
  }

Result for $ ./gradlew app:dependencies --configuration=apt

+--- com.google.guava:guava:19.0
+--- 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

Result for $ ./gradlew installDebug

BUILD SUCCESSFUL

Test 3

dataBinding {
    enabled = true
    version = "2.0.0"
  }

Result for $ ./gradlew app:dependencies --configuration=apt

+--- 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

Result for $ ./gradlew installDebug

BUILD SUCCESSFUL

For all tests

tbroyer commented 8 years ago

From my PoV, Dagger 2.4 is OK, but com.android.tools.build:gradle:2.1.0 is broken (test 3 above being the "proof", as well as inspecting the content of the JARs). Another test: create a small annotation processor with a dependency on Guava 19 and using com.google.common.collect.ImmutableSetMultimap.Builder.putAll(java.lang.Iterable<?>), and use it instead of Dagger; I'm sure it'd fail or succeed in the same way, under the same conditions.

AlokBansal8 commented 8 years ago

@tbroyer So what can be the solution? Can you please list it somewhere so it can be corrected or point me in that direction?

ubarua123 commented 8 years ago

Based on findings by @AlokBansal8 , test 3 worked, but, proguard build fails. It starts spewing out errors like Warning:com.squareup.javapoet.AnnotationSpec$Visitor: can't find superclass or interface javax.lang.model.util.SimpleAnnotationValueVisitor7 Warning:com.squareup.javapoet.JavaFile$2: can't find superclass or interface javax.tools.SimpleJavaFileObject Warning:com.squareup.javapoet.TypeName$1: can't find superclass or interface javax.lang.model.util.SimpleTypeVisitor7 Warning:dagger.internal.codegen.Accessibility$ElementAccessibilityVisitor: can't find superclass or interface javax.lang.model.util.SimpleElementVisitor6 Warning:dagger.internal.codegen.Accessibility$TypeAccessiblityVisitor: can't find superclass or interface javax.lang.model.util.SimpleTypeVisitor6 Warning:dagger.internal.codegen.Binding$1: can't find superclass or interface javax.lang.model.util.SimpleTypeVisitor6 Warning:dagger.internal.codegen.Binding$2: can't find superclass or interface javax.lang.model.util.SimpleTypeVisitor6 Warning:dagger.internal.codegen.BindingGraphValidator$Validation$2: can't find superclass or interface javax.lang.model.util.SimpleTypeVisitor6 Warning:dagger.internal.codegen.BindingGraphValidator$Validation$2$1: can't find superclass or interface javax.lang.model.util.SimpleTypeVisitor6

I read somewhere that I don't need to add any proguard rules for Dagger.

Tried with com.android.tools.build:gradle:2.1.0 and com.android.tools.build:gradle:2.0.0

Guess I am going back to Android Studio 1.5.1.

AlokBansal8 commented 8 years ago

Using new Jack toolchain along with 'com.android.tools.build:gradle:2.2.0-alpha1' I got following error:

Error:Execution failed for task ':app:transformJackWithJackForDebug'.
> com.android.jack.ir.JNodeInternalError: java.lang.Exception: java.lang.NoSuchMethodError: com.google.common.base.CharMatcher.whitespace()Lcom/google/common/base/CharMatcher;

This error was persistent, despite using annotationProcessor 'com.google.guava:guava:19.0'

Result for ./gradlew app:dependencies --configuration=annotationProcessor was following:

+--- com.google.guava:guava:19.0
\--- 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

Important thing to note is note is that earlier problem was with com.google.common.collect.ImmutableSetMultimap$Builder.putAll and now it is with com.google.common.base.CharMatcher.whitespace

ronshapiro commented 8 years ago

Seems related to that previous error that the gradle plugin had an old version of guava. Try adding apt 'com.google.guava:guava:19.0'

williamwebb commented 8 years ago

The new configuration for Jack is annotationProcessor which @AlokBansal8 tried.

With that said, annotationProcessor is brand new, it may have different behaviors then apt.

ronshapiro commented 8 years ago

sorry, use annotationProcessor, not apt. I think the issue is probably the same though, that the android gradle plugin's version of guava is on the annotation processor classpath

AlokBansal8 commented 8 years ago

@ronshapiro I already tried annotationProcessor 'com.google.guava:guava:19.0' and its not working.

AlokBansal8 commented 8 years ago

Using buildToolsVersion "24rc4"and gradle:2.2.0-alpha3 along with android-apt:1.8. I was able to run my app without compile time guava dependency. Has anybody tried it?

williamwebb commented 8 years ago

@AlokBansal8 same experience. Working with same config, not working with annotationProcessor.

AlokBansal8 commented 8 years ago

@williamwebb You can see here that annotationProcessor generates files in build/intermediates/classes/ instead of build/generated/source/which Android Studio can't recognise. @nickwph has posted a temporary solution in the same comment. However it can be found here.

williamwebb commented 8 years ago

@AlokBansal8 thanks!

I am however still running into the java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSetMultimap$Builder.putAll error, using gradle:2.2.0-alpha3.

nickwph commented 8 years ago

@williamwebb try adding classpath 'com.google.guava:guava:18.0' into your buildscript dependency like i did here. I filed a ticket about this bug some time ago.

AlokBansal8 commented 8 years ago

@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 apt 'com.google.guava:guava:19.0'

ubarua123 commented 8 years ago

Worked for me finally. I don't know if it'll work for others:

dataBinding { enabled = true version = "2.0.0" }

Classpath: com.android.tools.build:gradle:2.1.2

apt 'com.google.dagger:dagger-compiler:2.4' compile 'com.google.dagger:dagger:2.4'

No errors on either release build or debug build. I have other annotation processors too in my project.

carlonzo commented 8 years ago

OT: where this version = "2.0.0" for the dataBinding is coming from??

williamwebb commented 8 years ago

@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.

AlexTrotsenko commented 8 years ago

I also have ...NoSuchMethodError: ...FluentIterable.append(...) error at compilation.

  1. In my buildscript.dependencies I have :
    • build:gradle:2.1.2,
    • android-apt:1.8
    • gradle-retrolambda:3.3.0-beta4
  2. in my dependencies I have :
    • dagger:2.5
    • butterknife:8.1.0
    • ...

Fixes:

  1. Adding apt 'com.google.guava:guava:19.0' resolves compilation errors.
  2. Unfortunately, using buildToolsVersion "24rc4"and gradle:2.2.0-alpha3 along with android-apt:1.8 is not working for me.

In case it would be helpful:

  1. My build.gradle from apt_data_binding_issue_on_dagger branch of https://github.com/AlexTrotsenko/google-books-search project
  2. Detailed output of ./gradlew assembleDebug --debug: https://gist.github.com/AlexTrotsenko/bf9487f91ea9aa9637b692e3ad846f8c
  3. ./gradlew app:dependencies --configuration=apt output without extra guava:19.0 added:
Jack is required to support java 8 language features.
Incremental java compilation is an incubating feature.
Jack is required to support java 8 language features.
:app:dependencies

------------------------------------------------------------
Project :app
------------------------------------------------------------

apt
+--- com.jakewharton:butterknife-compiler:8.1.0
|    +--- com.google.auto:auto-common:0.6
|    |    \--- com.google.guava:guava:18.0 -> 19.0-rc2
|    +--- com.google.auto.service:auto-service:1.0-rc2
|    |    +--- com.google.auto:auto-common:0.3 -> 0.6 (*)
|    |    \--- com.google.guava:guava:18.0 -> 19.0-rc2
|    +--- com.squareup:javapoet:1.7.0
|    \--- com.jakewharton:butterknife-annotations:8.1.0
|         \--- com.android.support:support-annotations:23.3.0 -> 23.4.0
+--- com.google.dagger:dagger-compiler:2.1
|    +--- com.google.dagger:dagger:2.1
|    |    \--- javax.inject:javax.inject:1
|    +--- com.google.dagger:dagger-producers:2.1
|    |    +--- com.google.dagger:dagger:2.1 (*)
|    |    \--- com.google.guava:guava:19.0-rc2
|    \--- com.google.guava:guava:19.0-rc2
+--- com.android.support:appcompat-v7:23.4.0
|    +--- com.android.support:animated-vector-drawable:23.4.0
|    |    \--- com.android.support:support-vector-drawable:23.4.0
|    |         \--- com.android.support:support-v4:23.4.0
|    |              \--- com.android.support:support-annotations:23.4.0
|    +--- com.android.support:support-v4:23.4.0 (*)
|    \--- com.android.support:support-vector-drawable:23.4.0 (*)
+--- com.android.support:design:23.4.0
|    +--- com.android.support:recyclerview-v7:23.4.0
|    |    +--- com.android.support:support-annotations:23.4.0
|    |    \--- com.android.support:support-v4:23.4.0 (*)
|    +--- com.android.support:appcompat-v7:23.4.0 (*)
|    \--- com.android.support:support-v4:23.4.0 (*)
+--- com.android.support:cardview-v7:23.4.0
+--- com.android.support:recyclerview-v7:23.4.0 (*)
+--- com.jakewharton:butterknife:8.1.0
|    +--- com.jakewharton:butterknife-annotations:8.1.0 (*)
|    \--- com.android.support:support-annotations:23.3.0 -> 23.4.0
+--- com.squareup.retrofit2:retrofit:2.1.0
|    \--- com.squareup.okhttp3:okhttp:3.3.0
|         \--- com.squareup.okio:okio:1.8.0
+--- com.squareup.retrofit2:adapter-rxjava:2.1.0
|    +--- com.squareup.retrofit2:retrofit:2.1.0 (*)
|    \--- io.reactivex:rxjava:1.1.5
+--- com.squareup.retrofit2:converter-gson:2.1.0
|    +--- com.squareup.retrofit2:retrofit:2.1.0 (*)
|    \--- com.google.code.gson:gson:2.7
+--- com.jakewharton.rxbinding:rxbinding:0.4.0
|    +--- io.reactivex:rxandroid:1.1.0
|    |    \--- io.reactivex:rxjava:1.1.0 -> 1.1.5
|    +--- io.reactivex:rxjava:1.1.0 -> 1.1.5
|    \--- com.android.support:support-annotations:23.1.0 -> 23.4.0
+--- com.jakewharton.rxbinding:rxbinding-recyclerview-v7:0.4.0
|    +--- com.jakewharton.rxbinding:rxbinding:0.4.0 (*)
|    \--- com.android.support:recyclerview-v7:23.1.0 -> 23.4.0 (*)
+--- com.nostra13.universalimageloader:universal-image-loader:1.9.4
+--- com.google.dagger:dagger:2.1 (*)
+--- com.android.databinding:library:1.1
|    +--- com.android.support:support-v4:21.0.3 -> 23.4.0 (*)
|    \--- com.android.databinding:baseLibrary:1.1 -> 2.1.0
+--- com.android.databinding:baseLibrary:2.1.0
+--- com.android.databinding:adapters:1.1
|    +--- com.android.databinding:library:1.1 (*)
|    \--- com.android.databinding:baseLibrary:1.1 -> 2.1.0
+--- javax.annotation:jsr250-api:1.0
\--- com.android.databinding:compiler:2.1.0
     +--- com.android.databinding:baseLibrary:2.1.0
     \--- com.googlecode.juniversalchardet:juniversalchardet:1.0.3

(*) - dependencies omitted (listed previously)
JakeWharton commented 8 years ago

You're using Dagger 2.1 not 2.5.

AlexTrotsenko commented 8 years ago

@JakeWharton yes, this output from dagger 2.1. I was trying to find of why my build is broken and temporary changed it to 2.1 from 2.5. Looks like I posted them by mistake. My sources, which I posted above contains dagger 2.5.

Following is real output with dagger 2.5:

alex$ ./gradlew app:dependencies --configuration=apt
Jack is required to support java 8 language features.
Incremental java compilation is an incubating feature.
Jack is required to support java 8 language features.
:app:dependencies

------------------------------------------------------------
Project :app
------------------------------------------------------------

apt
+--- com.jakewharton:butterknife-compiler:8.1.0
|    +--- com.google.auto:auto-common:0.6
|    |    \--- com.google.guava:guava:18.0 -> 19.0
|    +--- com.google.auto.service:auto-service:1.0-rc2
|    |    +--- com.google.auto:auto-common:0.3 -> 0.6 (*)
|    |    \--- com.google.guava:guava:18.0 -> 19.0
|    +--- com.squareup:javapoet:1.7.0
|    \--- com.jakewharton:butterknife-annotations:8.1.0
|         \--- com.android.support:support-annotations:23.3.0 -> 23.4.0
+--- com.google.dagger:dagger-compiler:2.5
|    +--- com.google.dagger:dagger:2.5
|    |    \--- javax.inject:javax.inject:1
|    +--- com.google.dagger:dagger-producers:2.5
|    |    +--- com.google.dagger:dagger:2.5 (*)
|    |    \--- com.google.guava:guava:19.0
|    \--- com.google.guava:guava:19.0
+--- com.android.support:appcompat-v7:23.4.0
|    +--- com.android.support:animated-vector-drawable:23.4.0
|    |    \--- com.android.support:support-vector-drawable:23.4.0
|    |         \--- com.android.support:support-v4:23.4.0
|    |              \--- com.android.support:support-annotations:23.4.0
|    +--- com.android.support:support-v4:23.4.0 (*)
|    \--- com.android.support:support-vector-drawable:23.4.0 (*)
+--- com.android.support:design:23.4.0
|    +--- com.android.support:recyclerview-v7:23.4.0
|    |    +--- com.android.support:support-annotations:23.4.0
|    |    \--- com.android.support:support-v4:23.4.0 (*)
|    +--- com.android.support:appcompat-v7:23.4.0 (*)
|    \--- com.android.support:support-v4:23.4.0 (*)
+--- com.android.support:cardview-v7:23.4.0
+--- com.android.support:recyclerview-v7:23.4.0 (*)
+--- com.jakewharton:butterknife:8.1.0
|    +--- com.jakewharton:butterknife-annotations:8.1.0 (*)
|    \--- com.android.support:support-annotations:23.3.0 -> 23.4.0
+--- com.squareup.retrofit2:retrofit:2.1.0
|    \--- com.squareup.okhttp3:okhttp:3.3.0
|         \--- com.squareup.okio:okio:1.8.0
+--- com.squareup.retrofit2:adapter-rxjava:2.1.0
|    +--- com.squareup.retrofit2:retrofit:2.1.0 (*)
|    \--- io.reactivex:rxjava:1.1.5
+--- com.squareup.retrofit2:converter-gson:2.1.0
|    +--- com.squareup.retrofit2:retrofit:2.1.0 (*)
|    \--- com.google.code.gson:gson:2.7
+--- com.jakewharton.rxbinding:rxbinding:0.4.0
|    +--- io.reactivex:rxandroid:1.1.0
|    |    \--- io.reactivex:rxjava:1.1.0 -> 1.1.5
|    +--- io.reactivex:rxjava:1.1.0 -> 1.1.5
|    \--- com.android.support:support-annotations:23.1.0 -> 23.4.0
+--- com.jakewharton.rxbinding:rxbinding-recyclerview-v7:0.4.0
|    +--- com.jakewharton.rxbinding:rxbinding:0.4.0 (*)
|    \--- com.android.support:recyclerview-v7:23.1.0 -> 23.4.0 (*)
+--- com.nostra13.universalimageloader:universal-image-loader:1.9.4
+--- com.google.dagger:dagger:2.5 (*)
+--- com.android.databinding:library:1.1
|    +--- com.android.support:support-v4:21.0.3 -> 23.4.0 (*)
|    \--- com.android.databinding:baseLibrary:1.1 -> 2.1.2
+--- com.android.databinding:baseLibrary:2.1.2
+--- com.android.databinding:adapters:1.1
|    +--- com.android.databinding:library:1.1 (*)
|    \--- com.android.databinding:baseLibrary:1.1 -> 2.1.2
\--- com.android.databinding:compiler:2.1.2
     +--- com.android.databinding:baseLibrary:2.1.2
     \--- com.googlecode.juniversalchardet:juniversalchardet:1.0.3

(*) - dependencies omitted (listed previously)
AlokBansal8 commented 8 years ago

Guys using gradle 2.2.0-alpha6 I am not facing this problem anymore, both in debug and release versions and if everybody is satisfied then I would like to close this issue.

AlexTrotsenko commented 8 years ago

@AlokBansal8 thanks for the info. I will try to check my project with gradle 2.2.0-alpha6 and post the result. It was not working for me with gradle 2.2.0-alpha3

lykhonis commented 8 years ago

For me it seems that:

Data Binding enabled

Dagger 2.2 with Gradle 2.1.2 OK. Dagger 2.6 with Gradle 2.1.2 ERROR. Dagger 2.6 with Gradle 2.1.3 OK.