Open PKReejesh opened 1 year ago
When debugging with this line, inside LiveDataCallAdapterFactory
get
method,
String name = returnType.getClass().getName(); //to get full.package.name.of.Cat
Log.i(TAG,"Check#in between:"+name);
Found differences in release and debug apk.
Debug apk printed the log as : Check#in between:libcore.reflect.ParameterizedTypeImpl Release apk printed the log as : Check#in between:java.lang.Class
Also with breakpoints, I was able to see that, the Type
variable was wrapped with a LiveData
So,
Adding
-keep class androidx.lifecycle.LiveData { *; }
to proguard solved the issue.
I am getting two errors
java.lang.IllegalArgumentException: Unable to create call adapter for class androidx.lifecycle.LiveData from the caller.
Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType , which is pointed at the line
if (getRawType(returnType) != LiveData::class.java) { return null }
File : https://github.com/android/architecture-components-samples/blob/master/GithubBrowserSample/app/src/main/java/com/android/example/github/util/LiveDataCallAdapterFactory.kt
This happens in the release apk. Recent changes : Added co routine components.
Requesting to explain the issue please.