Lutaaya Huzaifah Idris Lutaaya Huzaifah Idris - 2 months ago 25
Android Question

Retrofit 2.1.0 GsonConverterFactory.create()

I have read all the posts on Retrofit , but still i havent got the solution why

GsonConverterFactory.create()
has an error , i have
compile 'com.squareup.retrofit2:retrofit:2.0.0'
and
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
but still the error is still visisble on the top below is the Image

This is the image

Answer

In your build.gradle file add

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

be sure to use the same version of both

EDIT:

In your top gradle file , which is build.gradle (module project) , add jcenter() . So your top gradle file should look like this

buildscript {
  repositories {
    jcenter()
  }
  dependencies {
   // please use the build tool version you are using right now 
   // it might be different 
    classpath 'com.android.tools.build:gradle:2.0.0'
  }
}

allprojects {
  repositories {
    jcenter()
  }
}
Comments