Error in retrofit2 convert-gson:2.1.0

Asked

Viewed 104 times

0

I’m having a very persistent error in Retrofit2 this with line error

GsonConverterFactory.create()

I’ve tried a lot of things and I can’t make it spin.

Retrofit retrofit = new Retrofit.Builder()
        .baseUrl(UdacityService.BASE_URL)
        .addCallAdapterFactory(GsonConverterFactory.create())
        .build();

My Gradle is as follows:

compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'

Álguem knows how to solve, please?

  • What error are you getting? (Edit your question)

  • 2

    Instead of addCallAdapterFactory(GsonConverterFactory.create()) will not be addConverterFactory(GsonConverterFactory.create())?

  • Post as an answer, not a comment, the correct information to solve your problem and mark as correct. So help others who have the same doubt.

  • That’s exactly what it was!! Thank you very much

1 answer

1

Instead of

addCallAdapterFactory(GsonConverterFactory.create()) 

is

addConverterFactory(GsonConverterFactory.create())

Browser other questions tagged

You are not signed in. Login or sign up in order to post.