Meituan-Dianping / Meituan-Dianping/Robust

patch应用成功但并没有效果

Open
#372 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.5k
Forks
806
PR merge metrics
No merged PRs in 30d

Description

Robust版本:0.4.91

Gradle版本:3.5.3 gradle-5.4.1

系统:mac

堆栈/日志:

2020-01-07 08:58:44.519 1624-2905/? I/ActivityManager: START u0 {cmp=com.xxxx.sdk.android.hotfixdemo/.MainActivity} from uid 10085
2020-01-07 08:58:44.557 19922-19922/? W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])' on a null object reference
2020-01-07 08:58:44.557 19922-19922/? W/System.err: at com.meituan.robust.utils.EnhancedRobustUtils.invokeReflectMethod(EnhancedRobustUtils.java:2)
2020-01-07 08:58:44.557 19922-19922/? W/System.err: at com.xxxx.robust.hotfix.PatchManipulateImp.MainActivityPatch.onCreate(MainActivityPatch.java:30)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at com.xxxx.robust.hotfix.PatchManipulateImp.MainActivityPatchControl.accessDispatch(Unknown Source:75)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at com.meituan.robust.PatchProxy.accessDispatch(PatchProxy.java:9)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at com.meituan.robust.PatchProxy.proxy(PatchProxy.java:4)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at com.xxxx.sdk.android.hotfixdemo.MainActivity.onCreate(Unknown Source:19)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at android.app.Activity.performCreate(Activity.java:7009)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at android.app.Activity.performCreate(Activity.java:7000)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at android.app.ActivityThread.-wrap11(Unknown Source:0)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
2020-01-07 08:58:44.558 19922-19922/? W/System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
2020-01-07 08:58:44.559 19922-19922/? W/System.err: at android.os.Looper.loop(Looper.java:164)
2020-01-07 08:58:44.559 19922-19922/? W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6494)
2020-01-07 08:58:44.559 19922-19922/? W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2020-01-07 08:58:44.559 19922-19922/? W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
2020-01-07 08:58:44.559 19922-19922/? W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
2020-01-07 08:58:44.559 19922-19922/? W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
2020-01-07 08:58:44.559 19922-19922/? W/System.err: at com.meituan.robust.utils.EnhancedRobustUtils.getDeclaredMethod(EnhancedRobustUtils.java:3)
2020-01-07 08:58:44.559 19922-19922/? W/System.err: at com.meituan.robust.utils.EnhancedRobustUtils.invokeReflectMethod(EnhancedRobustUtils.java:1)
2020-01-07 08:58:44.560 19922-19922/? W/System.err: at com.xxxx.robust.hotfix.PatchManipulateImp.MainActivityPatch.onCreate(MainActivityPatch.java:30)
2020-01-07 08:58:44.560 19922-19922/? W/System.err: at com.xxxx.robust.hotfix.PatchManipulateImp.MainActivityPatchControl.accessDispatch(Unknown Source:75)
2020-01-07 08:58:44.560 19922-19922/? W/System.err: at com.meituan.robust.PatchProxy.accessDispatch(PatchProxy.java:9)
2020-01-07 08:58:44.560 19922-19922/? W/System.err: at com.meituan.robust.PatchProxy.proxy(PatchProxy.java:4)
2020-01-07 08:58:44.560 19922-19922/? W/System.err: at com.xxxx.sdk.android.hotfixdemo.MainActivity.onCreate(Unknown Source:19)
2020-01-07 08:58:44.560 19922-19922/? W/System.err: at android.app.Activity.performCreate(Activity.java:7009)
2020-01-07 08:58:44.560 19922-19922/? W/System.err: at android.app.Activity.performCreate(Activity.java:7000)
2020-01-07 08:58:44.560 19922-19922/? W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
2020-01-07 08:58:44.560 19922-19922/? W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
2020-01-07 08:58:44.560 19922-19922/? W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
2020-01-07 08:58:44.561 19922-19922/? W/System.err: at android.app.ActivityThread.-wrap11(Unknown Source:0)
2020-01-07 08:58:44.561 19922-19922/? W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
2020-01-07 08:58:44.561 19922-19922/? W/System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
2020-01-07 08:58:44.561 19922-19922/? W/System.err: at android.os.Looper.loop(Looper.java:164)
2020-01-07 08:58:44.561 19922-19922/? W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6494)
2020-01-07 08:58:44.561 19922-19922/? W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2020-01-07 08:58:44.561 19922-19922/? W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
2020-01-07 08:58:44.562 19922-19922/? W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Android hotfix failure with Robust 0.4.91 and the listed Gradle versions, then inspect EnhancedRobustUtils and MainActivityPatch.onCreate at MainActivityPatch.java:30. Use the stack trace to trace the reflective call through PatchProxy and MainActivityPatchControl. Done means identifying why the patch's reflective lookup fails and confirming that the patch takes effect without the reported null-pointer errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.