dagger2 cannot find symbol

三世轮回 提交于 2019-12-04 20:45:32

You have the causality of your errors backwards. The Dagger* classes are the final output of the annotation processor. Because you had an error in your graph, the Dagger processor couldn't complete, so the output was missing.

The second error is saying that you are requesting SharedPreferences from within a component that doesn't have it bound. Because you've chosen component dependencies rather than subcomponents, all of the bindings from your dependencies are not inherited. In order for your LoadingComponent to use bindings from NetComponent they must be exposed on the component interface. Adding SharedPreferences sharedPreferences(); to NetComponent or switching to subcomponents should fix your problem.

See the @Component docs and the page on subcomponents in the user's guide for more information.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!