参考 https://github.com/square/retrofit/issues/3751#issuecomment-1192043644

混淆规则中加入如下规则:

 -keep,allowobfuscation,allowshrinking interface retrofit2.Call
 -keep,allowobfuscation,allowshrinking class retrofit2.Response
 # With R8 full mode generic signatures are stripped for classes that are not
 # kept. Suspend functions are wrapped in continuations where the type argument
 # is used.
 -keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

报错信息如下:

java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
retrofit2.HttpServiceMethod.parseAnnotations(HttpServiceMethod.java:46)
retrofit2.ServiceMethod.parseAnnotations(ServiceMethod.java:39)
retrofit2.Retrofit.loadServiceMethod(Retrofit.java:202)
retrofit2.Retrofit$1.invoke(Retrofit.java:160)
java.lang.reflect.Proxy.invoke(Proxy.java:813)

​

更多推荐