Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not resolve symbol for dagger component in android

I'm trying to add Dagger2 to my project in Android Studio.

This is my dependencies.

compile 'com.google.dagger:dagger:2.8'
annotationProcessor 'com.google.dagger:dagger-compiler:2.8'
provided 'javax.annotation:jsr250-api:1.0'

I am following this example.

https://guides.codepath.com/android/Dependency-Injection-with-Dagger-2#advantages

I am getting this error.

Can not resolve symbol DaggerNetComponent

I tried changing dependencies and other solution found after googling. but no luck.

Can anyone help me on this?

like image 568
Devesh Agrawal Avatar asked Dec 21 '16 17:12

Devesh Agrawal


1 Answers

The DaggerNetComponent is generated after compilation. You should enable annotation processing in compilation to generate that file. This link has the details.

These generated file should be added to the source path of the project to get recognized.

like image 57
rabhis Avatar answered Sep 19 '22 12:09

rabhis