Я пытаюсь следовать руководству Retrofit 2, но в этой части кода есть GsonConverterFactory, который отображает ошибку Невозможно разрешить символ:
public class ServiceGenerator {
public static final String API_BASE_URL = "http://your.api-base.url";
private static OkHttpClient httpClient = new OkHttpClient();
private static Retrofit.Builder builder =
new Retrofit.Builder()
.baseUrl(API_BASE_URL)
//THIS IS THE LINE WITH ERROR!!!!!!!!!!!!
.addConverterFactory(GsonConverterFactory.create());
public static S createService(Class serviceClass) {
Retrofit retrofit = builder.client(httpClient).build();
return retrofit.create(serviceClass);
}
}
Ранее я добавлял в свой gradle.build, но не уверен, стоит ли мне добавлять GSON, поскольку говорят, что он есть в Retrofit 1.9, но о Retrofit 2 ничего не упоминается:< /p>
dependencies {
// Retrofit & OkHttp
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
}
Источник: https://stackoverflow.com/questions/333 ... nnot-resol