Unable to create converter for class`

测试的时候出了问题。
java.lang.IllegalArgumentException: Unable to create converter for class`
最后查看代码少了一句话而已。真是闹心啊。

Retrofit retrofit = new Retrofit.Builder()
                .baseUrl("http://apis.baidu.com/acman/zhaiyanapi/tcrand/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();

少了这句话 addConverterFactory(GsonConverterFactory.create())
加这句话的时候,别忘记导包了。这个文件里面bulid.gradle 导
compile “com.squareup.retrofit2:converter-gson:2.0.2”

猜你喜欢

转载自blog.csdn.net/u013290250/article/details/51613032
今日推荐