I'm trying to use in my application a third-party library that wraps Loggly(logging web service).
I used all over my app Retrofit2 but all of the third-party libs that wrap Loggly use the old Retrofit 1.9.0.
Now, I'm keep getting ClassNotFoundException from these libs because they are trying to access a class that only exists in Retrofit 1.9.0 and not in 2.0.0.
I'm trying to solve it in a straightforward way - adding both Retrofit 1.9.0 and Retrofit 2.0.0 to my project but unfortunately gradle doesn't seems to support this.
So the problem here is how to add two different versions of the same library to your build.gradle file
Maybe you should create a new module for the loggly services and access it via interfaces. This means your main app will still depend on retrofit 2 and the new module with loggly will have its own gradle build with retrofit 1.
In our app we use a presentation - domain (MVC) structure. This means the networking is in its own module which means we might have a retrofit 1 and retrofit 2 module which has its own implementations, interfaces, and gradle dependencies it depends on. The domain layer then references these modules.
Glad I could help!.