dart icon indicating copy to clipboard operation
dart copied to clipboard

Not working when Dagger is also in app?

Open phundal209 opened this issue 8 years ago • 1 comments

Hi, I have Dagger in my app and added Dart and Henson as such:

//Dart
compile 'com.f2prateek.dart:dart:2.0.1'
provided 'com.f2prateek.dart:dart-processor:2.0.1'
//Henson
compile 'com.f2prateek.dart:henson:2.0.1'
annotationProcessor 'com.f2prateek.dart:henson-processor:2.0.1'

compile 'com.google.dagger:dagger:2.0.1'
compile 'javax.annotation:jsr250-api:1.0'
apt "com.google.dagger:dagger-compiler:2.0.1"

When I run the app I get an error:

Error:(15, 39) error: cannot find symbol class DaggerApplicationComponent

All I have added is Dart.inject(this) in one of my activities with a few extras injected. Is the gradle off or does this library not play well with Dagger?

phundal209 avatar Dec 02 '16 21:12 phundal209

We are not aware of anything that could explain an incompatibility with Dagger 1 or 2.

Though, I would try the following things:

  • do not mix the provided, annotationProcessor, and apt scopes in your build. It's quite likely that they don't play well with each other. Use either apt for all or annotationProcessor for all
  • try changing the order of the annotation processors if the above doesn't work (that's really a last chance guess).

S.

2016-12-02 13:38 GMT-08:00 phundal209 [email protected]:

Hi, I have Dagger in my app and added Dart and Henson as such:

//Dart compile 'com.f2prateek.dart:dart:2.0.1' provided 'com.f2prateek.dart:dart-processor:2.0.1' //Henson compile 'com.f2prateek.dart:henson:2.0.1' annotationProcessor 'com.f2prateek.dart:henson-processor:2.0.1'

compile 'com.google.dagger:dagger:2.0.1' compile 'javax.annotation:jsr250-api:1.0' apt "com.google.dagger:dagger-compiler:2.0.1"

When I run the app I get an error:

Error:(15, 39) error: cannot find symbol class DaggerApplicationComponent

All I have added is Dart.inject(this) in one of my activities with a few extras injected. Is the gradle off or does this library not play well with Dagger?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/f2prateek/dart/issues/142, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv33TXU2Qc8JpGw6dHxt4v8Zfo4czX8ks5rEI_rgaJpZM4LDBCB .

stephanenicolas avatar Dec 03 '16 18:12 stephanenicolas