I built a library that does some network requests with Retrofit. Retrofit is included in the library as a JAR file. I want to ship the library as .aar file.
The host app that will consume the .aar file will need to have Retrofit too since it needs to do some network requests.
What the host app should do?
Use the Retrofit library of the .aar file?
I've tried that and is working, the problem is that doesn't sound like a maintainable solution since the host app will be tied to the Retrofit version inside the library.
Include another version of Retrofit?
I've tried that and I'm getting errors when I compile the host app since I have multiple versions of the Retrofit files. e.g:
More than one file was found with OS independent path 'okhttp3/internal/publicsuffix/NOTICE'
Is there any other solution?
I read that I can use the transitive option but if I do that the library will be dependent from the Retrofit version of the host app right?