Dagger 1 and Dagger 2 package names conflict

只愿长相守 提交于 2021-01-28 22:23:09

问题


I have an Android project in which one 3rd party library depends on Dagger 1 and my project on Dagger 2.

Dagger 1 and 2 have the same package names so my app is working fine, but 3rd party library is not working because of overriding dagger 1 package by dagger 2.

Changing the package name of Dagger 2 to dagger2 instead of dagger is not an option because annotation compiler is generating classes with static package name dagger.

Is there a way of resolving this conflict?


回答1:


Use jarjar on the 3rd party library jar, or at least the dagger parts. That will move the dagger code (and any references) into its own package. As that is happening after the annotation processor has run it should catch all the code.



来源:https://stackoverflow.com/questions/32452209/dagger-1-and-dagger-2-package-names-conflict

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