Retrofit 2.0.0-beta4: Unable to create converter for class

Here are my files:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile ''
    compile ''
    compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
    compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
    compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
    compile ''
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
Pojo Model class:
@Table(name = "ModelTableName")
public class DataEntity extends Model {

    @Column(name = "_id")
    private String _id;

    @Column(name = "imageUri")
    private String uri;

    @Column(name = "title")
    private String title;

    public DataEntity() {

    public void set_id(String _id) {
        this._id = _id;

    public void setUri(String uri) {
        this.uri = uri;

    public void setTitle(String title) {
        this.title = title;

    public String get_id() {
        return _id;

    public String getUri() {
        return uri;

    public String getTitle() {
        return title;

Retrofit service:

protected Retrofit build() {
        if (null == retrofit) {
            HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
            OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();

            retrofit = new Retrofit.Builder()
        return retrofit;

I am using retrofit for API calls and for database using ActiveAndroid. On Pre 6.0 Android devices, an app is working perfectly. Not able to identify the root cause.

Gone through the following post:

Retrofit 2 beta-4. Android 6. Unable to create convertor

I couldn't understand that what is the need to use gson or gsonbuilder ?

Any help appreciated.


They have now released a stable version of Retrofit. Try using this

compile 'com.squareup.retrofit2:retrofit:2.0.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'

Also if you are using ActiveAndroid then you should create your retrofit object like this

Retrofit retrofit = new new Retrofit.Builder()
                    GsonConverterFactory.create(new GsonBuilder()
                            .excludeFieldsWithModifiers(Modifier.FINAL, Modifier.TRANSIENT, Modifier.STATIC)

because Model class contains some static and transient fields. Hope this helps.

Need Your Help

LINQ Help to a specific questrion to sum some things depending on their same category

linq database-design

I have an entity. A table named TABLE with 2 columns and 6 rows, and a connection to Database called db.

howto write an LDAP schema?


i want to introduce a new class "MyAppValues".