I am trying to build the project which has a large dependency graph and uses dagger 2. I use following dependencies
implementation 'com.google.dagger:dagger:2.11'
androidTestImplementation 'com.google.dagger:dagger:2.11'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
I am not able to build the app because it shows 50 errors like
cannot find symbol class DaggerAddressComponent
cannot find symbol class DaggerAddToCartActivityComponent
cannot find symbol class DaggerPaymentFragmentComponent
cannot find symbol variable GlideApp
...More 50 like this
All the DaggerComponent are not found and I also don't see any dagger classes created in generatedJava Folder. I know this may happen due to syntax error, but I checked all the modules and don't see any.
Does Someone know how to fix this? Or guide me on how to track down any mistakes in my modules/components. gradle log does not show anything related to dagger so how can we know where is the mistake?
答案 0 :(得分:0)
经过一整天,遍历代码的每一行,我发现我的视图界面中有一个重复的方法,该方法发生在合并期间。删除了,一切都很好。
奇怪的是,Android Studio如何显示所有未找到的类错误,并且不显示该错误。我知道这是一个愚蠢的错误,但是如果您在日志中看不到该错误,则很难找到真正的错误。