简体   繁体   中英

Dagger 1 and Dagger 2 package names conflict

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM