alibaba / AndFix

AndFix is a library that offer hot-fix for Android App.
Other
6.97k stars 1.6k forks source link

dalvik虚拟机可以测通,但在art上会报runtime error #274

Open k525245669 opened 8 years ago

k525245669 commented 8 years ago

首先感谢阿里集团及项目作者开源了这个项目,在测试过程中,我发现在api19 dalvik虚拟机上可正常跑通流程。但是在 api 22 art虚拟机上在 loadPatch后,进入修改页面时报错。

错误复现

protect void onCreate(){ //如果在此修改一行代码,会报 java.lang.NoSuchMethodError andfixText(); }

protect void andfixTest(){ //在此修改一行代码,会报 java.lang.IncompatibleClassChangeError }

//错误信息1 FATAL EXCEPTION: main Process: com.example.hzligan.sdk, PID: 13249 java.lang.NoSuchMethodError: No super method onCreate(Landroid/os/Bundle;)V in class Lcom/lofter/in/activity/LofterInBaseActivity; or its super classes (declaration of 'com.lofter.in.activity.LofterInBaseActivity' appears in /data/app/com.example.hzligan.sdk-1/base.apk) at com.lofter.in.activity.HomeProductListActivity_CF.onCreate(HomeProductListActivity.java:54) at android.app.Activity.performCreate(Activity.java:6036) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2422) at android.app.ActivityThread.access$800(ActivityThread.java:159) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1319) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5313) 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:1116) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:809)

//错误信息2 java.lang.IncompatibleClassChangeError: The method 'void com.lofter.in.activity.HomeProductListActivity_CF.andfixtest()' was expected to be of type direct but instead was found to be of type virtual (declaration of 'com.lofter.in.activity.HomeProductListActivity' appears in /data/app/com.example.hzligan.sdk-1/base.apk) at com.lofter.in.activity.HomeProductListActivity.onCreate(HomeProductListActivity.java:76) at android.app.Activity.performCreate(Activity.java:6423) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2451) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2569) at android.app.ActivityThread.access$900(ActivityThread.java:160) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1409) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:935) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:726)

k525245669 commented 8 years ago

我回退到 fix#255 节点以后,发现就解决了该问题