I included these dependencies in my project:
compile 'com.squareup.retrofit: retrofit: 2.0.0-beta2'
compile 'com.squareup.retrofit: converter-gson: 2.0.0-beta1'
I have a class where I am going to access my api through retrofitting:
public static <S> S createService(Class<S> serviceClass, String baseUrl) { Retrofit builder = new Retrofit.Builder() .baseUrl(baseUrl) .addConverterFactory(GsonConverterFactory.create()) .build(); RestAdapter adapter = builder.build();*/ return builder.create(serviceClass); }
And now, this gives me this compile time error:
Error: (24, 17) error: the addConverterFactory method in the Builder class cannot be applied to the specified types; required: Factory found: Reason GsonConverterFactory: the actual argument GsonConverterFactory cannot be converted to Factory using method call conversion
How can i solve this? I followed the documentation. What's wrong?
android gson retrofit
AEMLoviji Oct 02 '15 at 7:10 2015-10-02 07:10
source share