问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/41268890/can-not-resolve-symbol-for-dagger-component-in-android