Mariusz
Mariusz

Reputation: 1410

Retrofit two version

I got module that use new Retrofit 2, and library in aar that depend on Retrofit 1.9

so my build.gradle dependencies looks like

compile project(':shop') // Module depend on retrofit2

compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
compile(name: 'dotpay-sdk', ext: 'aar') // Lib depend on retrofit1.9

however when i call method from lib i get NoClassDefFoundError most likely from RestAdapter.

is there option to use to version of same library?

Upvotes: 0

Views: 1143

Answers (1)

Sandro Machado
Sandro Machado

Reputation: 10205

Without a new release of the Retrofit it will be not easy to use both libraries at the same project, due they will cause you conflicts because they have the same package. In the final release Retrofit and OkHttp will came with the version on the package. You can read more about it here: http://jakewharton.com/java-interoperability-policy-for-major-version-updates/

If you really need to use both version there is an issue with some alternatives that you can use: https://github.com/square/retrofit/issues/1152

Upvotes: 3

Related Questions