I'm trying to use Retrofit 2.0.0.beta2, when setting up the Converter for Gson like below
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
After this gradle throwing error
GsonConverterFactory cannot be converted to Factory
How to fix it ???
you are probably the first beta of GsonConverterFactory
with the 2nd beta of Retrofit
. Please make sure that you have
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
in your gradle
I got the issue...
I was using compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1' instead of 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.google.code.gson:gson:2.3'}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With