public class TwoActivity extends Activity {
@SuppressLint("SetTextI18n")
@Override
@Modify
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_two);
TextView text = (TextView) findViewById(R.id.text);
text.setText("Hello " + getInfo());
}
@Add
public String getInfo(){
return "DemoTest";
}
}
堆栈/日志:
java.lang.RuntimeException: getDeclaredMethod error getInfo parameterTypes null targetObject com.project.robutdemo.TwoActivity@7db7f84
at com.meituan.robust.utils.EnhancedRobustUtils.getDeclaredMethod(EnhancedRobustUtils.java:69)
at com.meituan.robust.utils.EnhancedRobustUtils.invokeReflectMethod(EnhancedRobustUtils.java:33)
at com.project.robutdemo.TwoActivityPatch.onCreate(TwoActivityPatch.java:25)
at com.project.robutdemo.TwoActivityPatchControl.accessDispatch(PatchTemplate.java)
at com.meituan.robust.PatchProxy.accessDispatch(PatchProxy.java:94)
at com.meituan.robust.PatchProxy.proxy(PatchProxy.java:44)
at com.project.robutdemo.TwoActivity.onCreate(TwoActivity.java)
at android.app.Activity.performCreate(Activity.java:6355)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2438)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2545)
at android.app.ActivityThread.access$1100(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1396)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5597)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:771)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:649)
me: Shutting down VM
异常类型:app运行时异常
手机型号:三星S8
手机系统版本:Android 8.0
Robust版本:0.4.85
Gradle版本:4.6
系统:如:Windows
code:
public class TwoActivity extends Activity { @SuppressLint("SetTextI18n") @Override @Modify protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_two); TextView text = (TextView) findViewById(R.id.text); text.setText("Hello " + getInfo()); }
}
堆栈/日志:
java.lang.RuntimeException: getDeclaredMethod error getInfo parameterTypes null targetObject com.project.robutdemo.TwoActivity@7db7f84 at com.meituan.robust.utils.EnhancedRobustUtils.getDeclaredMethod(EnhancedRobustUtils.java:69) at com.meituan.robust.utils.EnhancedRobustUtils.invokeReflectMethod(EnhancedRobustUtils.java:33) at com.project.robutdemo.TwoActivityPatch.onCreate(TwoActivityPatch.java:25) at com.project.robutdemo.TwoActivityPatchControl.accessDispatch(PatchTemplate.java) at com.meituan.robust.PatchProxy.accessDispatch(PatchProxy.java:94) at com.meituan.robust.PatchProxy.proxy(PatchProxy.java:44) at com.project.robutdemo.TwoActivity.onCreate(TwoActivity.java) at android.app.Activity.performCreate(Activity.java:6355) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2438) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2545) at android.app.ActivityThread.access$1100(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1396) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5597) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:771) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:649) me: Shutting down VM