google / dagger

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

Program type already present: dagger.shaded.auto.common.AnnotationValues #1179

Closed gmavenis closed 6 years ago

gmavenis commented 6 years ago

Program type already present: dagger.shaded.auto.common.AnnotationValues$1$1$1 Message{kind=ERROR, text=Program type already present: dagger.shaded.auto.common.AnnotationValues$1$1$1, sources=[Unknown source file], tool name=Optional.of(D8)}

ronshapiro commented 6 years ago

Can you provide a small GitHub repo that exhibits this issue? Unfortunately this error alone isn't enough to diagnose the problem.

gmavenis commented 6 years ago

This is my sample https://github.com/gmavenis/jetpack Pls help to config Tks so much

tbroyer commented 6 years ago

dagger-compiler and dagger-android-processor dependencies need to be in annotationProcessor configuration, not implementation.

gmavenis commented 6 years ago

Thanks so much

On Mon, May 21, 2018 at 15:56 Thomas Broyer notifications@github.com wrote:

dagger-compiler and dagger-android-processor dependencies need to be in annotationProcessor configuration, not implementation.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google/dagger/issues/1179#issuecomment-390594873, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0GF9ZFKNAsu6V6o3wMq6v6qLaInB_sks5t0oE7gaJpZM4T7LAa .

saeid1222005 commented 5 years ago

it works .

gxshao commented 5 years ago

@tbroyer
Hi, bro; Here is facing same error:

Error: Program type already present: com.google.common.annotations.GwtCompatible

Seems like the dependency of gRPC conflict with dagger2's dependency. I was excluded one of 'com.google.guava', it doesn't work. I was excluded guava from gRPC, then compile success but can't find the common class at runtime, when i tried to excluded guava from dagger2, you know, unable to generate the Dagger classes... so desperate....