I had a similar crash IllegalArgumentException: Call return type must be parameterized as Call
.
Crash log:
Caused by: java.lang.IllegalArgumentException: Unable to create call adapter for interface retrofit2.Call
for method Api.login
at retrofit2.Utils.methodError(Utils.java:54)
at retrofit2.HttpServiceMethod.createCallAdapter(HttpServiceMethod.java:116)
at retrofit2.HttpServiceMethod.parseAnnotations(HttpServiceMethod.java:67)
at retrofit2.ServiceMethod.parseAnnotations(ServiceMethod.java:39)
at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:202)
at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
at $Proxy0.login(Unknown Source)
at <redacted>.screen.login.LoginActivity.onSignInClick(LoginActivity.java:103)
... 13 more
Caused by: java.lang.IllegalArgumentException: Call return type must be parameterized as Call<Foo> or Call<? extends Foo>
at retrofit2.DefaultCallAdapterFactory.get(DefaultCallAdapterFactory.java:42)
at retrofit2.Retrofit.nextCallAdapter(Retrofit.java:253)
at retrofit2.Retrofit.callAdapter(Retrofit.java:237)
at retrofit2.HttpServiceMethod.createCallAdapter(HttpServiceMethod.java:114)
... 20 more
I found out it was crashing because of Proguard/R8. Proguard was renaming Retrofit classes and to fix it I updated the Proguard settings with:
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }