Open
Description
热更新补丁加载的时候失败了,报的错误:
W/System.err: java.lang.VerifyError: Verifier rejected class PatchManipulateImp.TemplateViewManagerPatch: android.widget.TextView PatchManipulateImp.TemplateViewManagerPatch.createAndGetOriginalTextView() failed to verify: android.widget.TextView PatchManipulateImp.TemplateViewManagerPatch.createAndGetOriginalTextView(): [0x5D9] returning 'Reference: java.lang.Object', but expected from declaration 'Reference: android.widget.TextView' (declaration of 'PatchManipulateImp.TemplateViewManagerPatch' appears in patch2.10.0_38.jar_temp.jar)
查看补丁文件代码:
发现生成的 TemplateViewManagerPatch.createAndGetOriginalTextView 方法返回类型为TextView但是方法内却返回Object类型的对象
实际部分补丁代码:
private TextView createAndGetOriginalTextView(View paramView, JsonCardViewHolder paramJsonCardViewHolder, MessageData paramMessageData)
{
Object localObject1;
Context localContext;
label57: Object localObject2;
label159: int i;
label223: Object localObject3;
label291: label307: label473: Object localObject4;
...
return localObject4; //此处为什么会返回Object类型的对象,而不是函数定义的TextView?
Activity
jjlan commentedon Aug 30, 2019
我也遇到了这个问题,解决办法可以查看我的博客:https://www.jianshu.com/p/dae91cf497a3