(Retrofit) Could not locate converter for class crashing app

By | July 20, 2019


So Retrofit 2.0.0 was recently released and theres not really any updated examples on how to use it, but im trying to implement it for a basic API call. Im getting a

java.lang.IllegalArgumentException: Unable to create converter for class` 

caused by

Caused by: java.lang.IllegalArgumentException: Could not locate converter for class orbyt.app.dataclass. Tried:
* retrofit.OkHttpBodyConverterFactory

When trying to make the api call.


I was facing the same issue. I fixed it by adding :

compile 'com.squareup.retrofit2:converter-gson:<latest-version>'

to my build.gradle

Then specify the converter when creating my Retrofit instance.

Retrofit retrofit = new Retrofit.Builder()

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *