android – 错误:不兼容的类型:GsonConverterFactory无法转换为工厂

参见英文答案 > retrofit convertor factory can not access GsonConverterFactory5个
在设置Converter for时,我正在尝试使用Retrofit 2.0.0.beta2
Gson喜欢以下
Retrofit retrofit = new Retrofit.Builder()
            .baseUrl(BASE_URL)
            .addConverterFactory(GsonConverterFactory.create())
            .build();

这个gradle抛出错误之后

GsonConverterFactory cannot be converted to Factory

怎么解决???

解决方法

你可能是GsonConverterFactory的第一个测试版,它是Retrofit的第二个测试版.请确保你有
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'

在你的gradle中

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...