You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class TypeWrapper<T> {
protected final Type type;
protected TypeWrapper() {
Type superClass = getClass().getGenericSuperclass();
type = ((ParameterizedType) superClass).getActualTypeArguments()[0];
}
public Type getType() {
return type;
}
}
导致对象注入时候,类型解析抛出异常;
if(serializationService != null) {
val res = substitute.intent?.extras?.getString("list")
if(!res.isNullOrEmpty()) {
val typeWrapper = object : TypeWrapper<MutableList<String>>(){}
serializationService?.parseObject<MutableList<String>>(res, typeWrapper.type)?.let{
substitute.list = it
}
}
}
报错类似: Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType at com.alibaba.android.arouter.facade.model.TypeWrapper.(TypeWrapper.java:19)
见README 关于新增混淆规则的说明,如果出现这个问题即可采用如下方案:
The text was updated successfully, but these errors were encountered: