Ich bin eine einfache Nachrüstung zu schaffen, aber ich habe diesen Fehler:Android Retrofit kann nicht Symbol lösen AuthenticationInterceptor
Cannot resolve symbol AuthenticationInterceptor
hier:
public static <S> S createService(
Class<S> serviceClass, final String authToken) {
if (!TextUtils.isEmpty(authToken)) {
AuthenticationInterceptor interceptor =
new AuthenticationInterceptor(authToken);
if (!httpClient.interceptors().contains(interceptor)) {
httpClient.addInterceptor(interceptor);
builder.client(httpClient.build());
retrofit = builder.build();
}
}
return retrofit.create(serviceClass);
}
Mein Build gradle wie folgt aussieht:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.keiferstone:nonet:2.0.4'
compile 'com.github.GrenderG:Toasty:1.2.5'
compile 'com.lmntrx.livin.library.droidawesome:droid-awesome:1.1.9'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'me.pushy:sdk:1.0.28'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
}
Hallo ich dazu einen Teil des Codes zu ändern hatte 'public okhttp3.Response abfangen (Chain-Kette) löst IOException {', jetzt bekomme ich weniger Fehler, kann es nicht Symbol Nachrüstung hier 'Retrofit = builder.build();' – Olipol
So verwende ich dieses Tutorial https://futurestud.io/tutorials/oauth-2-on-android-with-retrofit – Olipol
Es ist oben definiert, in Ihrem Link: 'private statische Nachrüstung Retrofit = builder.build();' – ToYonos