retrofit convertor factory can not access GsonConverterFactory

前端 未结 5 1549
情话喂你
情话喂你 2020-12-08 18:38

I have included these dependencies to my project:

compile \'com.squareup.retrofit:retrofit:2.0.0-beta2\'
compile \'com.squareup.retrofit:convert

5条回答
  •  眼角桃花
    2020-12-08 18:50

    Try to use same version for retrofit and converter-gson - 2.0.0-beta2. You are using beta2 for retrofit and beta1 for converter.

    implementation 'com.squareup.retrofit:retrofit:2.0.0-beta2'
    implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
    

    Important note!

    Retrofit change its package name since 2.0.0-beta3 version. Now you should use com.squareup.retrofit2. Here is example:

    implementation 'com.squareup.retrofit2:retrofit:2.2.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
    

提交回复
热议问题