Ich habe Retrofit 2, okhttp und moshi-jsonapi in Android-Projekt verwendet. jedes Mal laufen onFailure von Rückruf in signierten ModusRun onFailure Nachrüstung 2 in Signed apk
Debug Build-apk und Anwendung ist richtig, aber ich habe Fehler in Build unterzeichnet apk (Release-Modus), I dontwarn
für passieren den Build unterzeichnet apk in proguard-rules.pro
verwendet, aber meine Anwendung.
Throwable Nachricht:
platform java.util.LinkedHashMap<java.lang.String,a.a.a.j> annotated [] requires explicit JsonAdapter to be registered
Ich habe nie LinkedHashMap verwendet!
Bei der Verwendung minifyEnabled false
unterzeichnet apk und Anwendung ist richtig, aber es ist keine sichere Lösung.
proguard-rules.pro:
-dontwarn okio.**
-keep class okio.** { *; }
-dontwarn retrofit2.**
-dontwarn org.codehaus.mojo.**
-dontnote retrofit2.Platform
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
-dontwarn retrofit2.Platform$Java8
-keep class retrofit2.** { *; }
-keepattributes Exceptions
-keepattributes Signature
-keepattributes RuntimeVisibleAnnotations
-keepattributes RuntimeInvisibleAnnotations
-keepattributes RuntimeVisibleParameterAnnotations
-keepattributes RuntimeInvisibleParameterAnnotations
-keepattributes EnclosingMethod
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}
-keepclasseswithmembers interface * {
@retrofit2.* <methods>;
}
Ich benutze Moshi. Modellattribute in Moshi sind '@Json (name =" name ") und ich habe das in jedem Modell benutzt, aber nicht funktioniert. –