AndFix Expected MainActivity_CF but got MainActivity

pzfprimi  于 3个月前  发布在  Go
关注(0)|答案(4)|浏览(70)

java.lang.IllegalArgumentException: Expected receiver of type com.patchtest.MainActivity_CF, but got com.patchtest.MainActivity
执行修复过的方法时报这个错误

0aydgbwb

0aydgbwb1#

@maxZhou7 有具体堆栈信息吗

ffscu2ro

ffscu2ro2#

@supern
Process: com.patchtest, PID: 2695
java.lang.IllegalArgumentException: Expected receiver of type com.patchtest.MainActivity_CF, but got com.patchtest.MainActivity
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:284)
at android.view.View.performClick(View.java:4909)
at android.view.View$PerformClick.run(View.java:20390)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5826)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1009)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:804)

bwleehnv

bwleehnv3#

@supern
现已发现出现该问题是因为在xml中设置的点击android:onClick="btnClick"。我修改成代码中设置点击事件,然后修复点击执行的内容 就没有问题并成功修复了。btn_.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
//todo
}
});

so,为什么不能在xml中直接设置android:onClick="btnClick"。

x7rlezfr

x7rlezfr4#

@maxZhou7 这是个已知问题,会后续修复的

相关问题