-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Hello, thanks for the library.
Recently I have faced with crash.
Steps to reproduce: add suspend function into ApiInterface
Looks like problem in this code block and method getTypeName not available on Android:
private fun isSuspendMethodWithListReturnValue(method: Method): Boolean {
val lastParameter = method.genericParameterTypes.lastOrNull() as? ParameterizedType ?: return false
if (!Continuation::class.java.isAssignableFrom(Class.forName(lastParameter.rawType.typeName))) {
return false
}
}Crash log:
Process: com.theapache64.notes, PID: 29094
java.lang.NoSuchMethodError: No interface method getTypeName()Ljava/lang/String; in class Ljava/lang/reflect/Type; or its super classes (declaration of 'java.lang.reflect.Type' appears in /system/framework/core-oj.jar)
at com.github.theapache64.retrosheet.RetrosheetInterceptor$Companion.isSuspendMethodWithListReturnValue(RetrosheetInterceptor.kt:89)
at com.github.theapache64.retrosheet.RetrosheetInterceptor$Companion.isReturnTypeList(RetrosheetInterceptor.kt:66)
at com.github.theapache64.retrosheet.RetrosheetInterceptor$Companion.access$isReturnTypeList(RetrosheetInterceptor.kt:38)
at com.github.theapache64.retrosheet.RetrosheetInterceptor.getRetrosheetResponse(RetrosheetInterceptor.kt:225)
at com.github.theapache64.retrosheet.RetrosheetInterceptor.intercept(RetrosheetInterceptor.kt:169)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:172)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels