Je crée une rénovation simple, mais je reçois cette erreur:Android Rénovation ne peut pas résoudre le symbole AuthenticationInterceptor
Cannot resolve symbol AuthenticationInterceptor
ici:
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);
}
Mon build gradle ressemble à ceci:
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'
}
Bonjour je devais changer une partie de votre code à ce 'public okhttp3.Response intercept (Chaîne de chaîne) jette IOException {', maintenant je reçois moins d'erreurs, il ne peut pas résoudre le symbole retrofit ici 'retrofit = builder.build();' – Olipol
Ainsi j'utilise ce tutoriel https://futurestud.io/tutorials/oauth-2-on-android-with-retrofit – Olipol
Il est défini ci-dessus, dans votre lien: 'privé statique Retrofit retrofit = builder.build();' – ToYonos