Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without a reboot.
4.41k
stars
806
forks
source link
跑demo没问题,运行自己的测试项目报错 NoSuchMethodError、NullPointerException、RuntimeException #319
Open
jinyindao opened 5 years ago
异常类型:app运行时异常
手机型号:模拟器 Samsung SM-G995N
手机系统版本:Android 5.1.1
Robust版本:0.4.87
Gradle版本:2.10
Plugin 版本:2.1.0
系统:windows
简要说明:demo 跑没问题,在自己的测试项目导出补丁、加载补丁都正常了(见下图日志),但是在运行的时候报错了:java.lang.NoSuchMethodError、java.lang.NullPointerException:、java.lang.RuntimeException:
堆栈/日志:
04-08 17:31:22.909 7599-7617/? I/cocos2d-x debug info: [4.9777] [INFO] android hotupdte down patch.jar success success success 04-08 17:31:22.912 7599-7617/? I/cocos2d-x debug info: [4.9873] - "android hotupdte startRobust = = = " = { 04-08 17:31:22.912 7599-7617/? I/cocos2d-x debug info: [4.9874] - 1 = { 04-08 17:31:22.913 7599-7617/? I/cocos2d-x debug info: [4.9879] - "appversion" = "0.0.0.1" 04-08 17:31:22.913 7599-7617/? I/cocos2d-x debug info: [4.9883] - "bytes" = 7270.4 04-08 17:31:22.913 7599-7617/? I/cocos2d-x debug info: [4.9883] - "code" = "505cc5220239ca7b14fb266b90682e9a" 04-08 17:31:22.913 7599-7617/? I/cocos2d-x debug info: [4.9884] - "name" = "0001.jar" 04-08 17:31:22.914 7599-7617/? I/cocos2d-x debug info: [4.9886] - "path" = "/data/data/com.testgame.qipai/files/robust/0001" 04-08 17:31:22.914 7599-7617/? I/cocos2d-x debug info: [4.9887] - } 04-08 17:31:22.914 7599-7617/? I/cocos2d-x debug info: [4.9888] - 2 = { 04-08 17:31:22.914 7599-7617/? I/cocos2d-x debug info: [4.9889] - "appversion" = "0.0.0.2" 04-08 17:31:22.914 7599-7617/? I/cocos2d-x debug info: [4.9890] - "bytes" = 7270.4 04-08 17:31:22.914 7599-7617/? I/cocos2d-x debug info: [4.9891] - "code" = "d40653d69ef1435a8942735fa6076fa7" 04-08 17:31:22.914 7599-7617/? I/cocos2d-x debug info: [4.9891] - "name" = "0002.jar" 04-08 17:31:22.915 7599-7617/? I/cocos2d-x debug info: [4.9894] - "path" = "/data/data/com.testgame.qipai/files/robust/0002" 04-08 17:31:22.915 7599-7617/? I/cocos2d-x debug info: [4.9900] - } 04-08 17:31:22.915 7599-7617/? I/cocos2d-x debug info: [4.9900] - } 04-08 17:31:22.916 7599-7617/? I/cocos2d-x debug info: [4.9911] [INFO] luaj.callStaticMethod("com/testgame/utils/robust/RobustUtils", "startRobust", args, "(Ljava/lang/String;I)V" 04-08 17:31:22.916 7599-7617/? I/System.out: RobustUtils init begin --- >>> 04-08 17:31:22.923 7599-7617/? I/System.out: runRobust --->>>> 04-08 17:31:22.923 7599-7617/? W/setPatchs: ----------------------setPatchs --------- 04-08 17:31:22.923 7599-7617/? W/startRobust ===: s_info = [{"path":"\/data\/data\/com.testgame.qipai\/files\/robust\/0001","code":"505cc5220239ca7b14fb266b90682e9a","bytes":7270.4,"appversion":"0.0.0.1","name":"0001.jar"},{"path":"\/data\/data\/com.testgame.qipai\/files\/robust\/0002","code":"d40653d69ef1435a8942735fa6076fa7","bytes":7270.4,"appversion":"0.0.0.2","name":"0002.jar"}] 04-08 17:31:22.923 7599-7645/? W/fetchPatchList =: fetchPatchList -> s_info -> [{"path":"\/data\/data\/com.testgame.qipai\/files\/robust\/0001","code":"505cc5220239ca7b14fb266b90682e9a","bytes":7270.4,"appversion":"0.0.0.1","name":"0001.jar"},{"path":"\/data\/data\/com.testgame.qipai\/files\/robust\/0002","code":"d40653d69ef1435a8942735fa6076fa7","bytes":7270.4,"appversion":"0.0.0.2","name":"0002.jar"}] 04-08 17:31:22.939 7599-7645/? W/jsonArray = =: name = = 0001.jar 04-08 17:31:22.939 7599-7645/? W/jsonArray = =: path = = /data/data/com.testgame.qipai/files/robust/0001 04-08 17:31:22.939 7599-7645/? W/jsonArray = =: name = = 0002.jar 04-08 17:31:22.939 7599-7645/? W/jsonArray = =: path = = /data/data/com.testgame.qipai/files/robust/0002 04-08 17:31:22.939 7599-7645/? D/robust: patchManipulate list size is 2
04-08 17:31:23.782 7646-7646/? I/dex2oat: dex2oat took 182.727ms (threads: 2) arena alloc=109KB java alloc=25KB native alloc=788KB free=7MB 04-08 17:31:23.788 7599-7645/? D/robust: PatchsInfoImpl name:com.meituan.robust.patch.PatchesInfoImpl 04-08 17:31:23.790 7599-7645/? D/robust: PatchsInfoImpl ok 04-08 17:31:23.791 7599-7645/? D/robust: current path:com.testgame.utils.wx.WeixinUtils 04-08 17:31:23.792 7599-7645/? D/robust: oldClass :class com.testgame.utils.wx.WeixinUtils fields 10 04-08 17:31:23.795 7599-7645/? D/robust: current path:com.testgame.utils.wx.WeixinUtils find:ChangeQuickRedirect com.meituan.robust.patch.WeixinUtilsPatchControl
04-08 17:31:23.798 7599-7645/? D/robust: changeQuickRedirectField set sucess com.meituan.robust.patch.WeixinUtilsPatchControl
04-08 17:31:23.798 7599-7645/? D/robust: patch finished 04-08 17:31:23.799 7599-7645/? D/RobustCallBack: onPatchApplied result: true 04-08 17:31:23.799 7599-7645/? D/RobustCallBack: onPatchApplied patch: 0001.jar
04-08 17:31:23.803 7599-7645/? D/robust: patch LocalPath:/data/data/com.testgame.qipai/files/robust/0001.jar,apply result true
04-08 17:31:23.860 7599-7617/? I/cocos2d-x debug info: [5.9352] [INFO] android hotupdte result = = true 04-08 17:31:23.861 7599-7617/? I/cocos2d-x debug info: [5.9362] [INFO] android hotupdte patchName = = 0001.jar 04-08 17:31:24.313 7659-7659/? I/dex2oat: /system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=x86 --instruction-set-features=default --runtime-arg -Xnorelocate --boot-image=/system/framework/boot.art --dex-file=/data/data/com.testgame.qipai/files/robust/0002_temp.jar --oat-fd=33 --oat-location=/data/data/com.testgame.qipai/cache/0002_temp.dex --runtime-arg -Xms64m --runtime-arg -Xmx512m 04-08 17:31:24.340 7659-7659/? I/dex2oat: dex2oat took 27.583ms (threads: 2) arena alloc=109KB java alloc=19KB native alloc=764KB free=7MB 04-08 17:31:24.345 7599-7645/? D/robust: PatchsInfoImpl name:com.meituan.robust.patch.PatchesInfoImpl 04-08 17:31:24.347 7599-7645/? D/robust: PatchsInfoImpl ok 04-08 17:31:24.347 7599-7645/? D/robust: current path:com.tencent.TencentUtils 04-08 17:31:24.349 7599-7645/? D/robust: oldClass :class com.tencent.TencentUtils fields 5 04-08 17:31:24.349 7599-7645/? D/robust: current path:com.tencent.TencentUtils find:ChangeQuickRedirect com.meituan.robust.patch.TencentUtilsPatchControl
04-08 17:31:24.351 7599-7645/? D/robust: changeQuickRedirectField set sucess com.meituan.robust.patch.TencentUtilsPatchControl
04-08 17:31:24.351 7599-7645/? D/robust: patch finished 04-08 17:31:24.351 7599-7645/? D/RobustCallBack: onPatchApplied result: true 04-08 17:31:24.351 7599-7645/? D/RobustCallBack: onPatchApplied patch: 0002.jar
04-08 17:31:24.351 7599-7645/? D/robust: patch LocalPath:/data/data/com.testgame.qipai/files/robust/0002.jar,apply result true
// 加载修改过WeixinUtils.java 的补丁 04-08 17:34:39.594 7599-7617/? D/robust: get static value is out No: 58 04-08 17:34:39.594 7599-7617/? I/System.out: 微信图片分享 -- 》 robust 04-08 17:34:39.594 7599-7617/? W/System.err: java.lang.NoSuchMethodError: No static method addFunc(Ljava/lang/String;)V in class Lcom/testgame/utils/wx/WeixinUtils; or its super classes (declaration of 'com.testgame.utils.wx.WeixinUtils' appears in /data/app/com.testgame.qipai-1/base.apk) 04-08 17:34:39.596 7599-7617/? W/System.err: at com.meituan.robust.patch.WeixinUtilsPatch.shareImage(WeixinUtilsPatch.java:305) 04-08 17:34:39.596 7599-7617/? W/System.err: at com.meituan.robust.patch.WeixinUtilsPatchControl.accessDispatch(PatchTemplate.java) 04-08 17:34:39.596 7599-7617/? W/System.err: at com.meituan.robust.PatchProxy.accessDispatch(PatchProxy.java:94) 04-08 17:34:39.596 7599-7617/? W/System.err: at com.meituan.robust.PatchProxy.proxy(PatchProxy.java:44) 04-08 17:34:39.596 7599-7617/? W/System.err: at com.testgame.utils.wx.WeixinUtils.shareImage(WeixinUtils.java) 04-08 17:34:39.596 7599-7617/? W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(Native Method) 04-08 17:34:39.596 7599-7617/? W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(Cocos2dxRenderer.java:125) 04-08 17:34:39.596 7599-7617/? W/System.err: at org.cocos2dx.lib.Cocos2dxGLSurfaceView$9.run(Cocos2dxGLSurfaceView.java:261) 04-08 17:34:39.596 7599-7617/? W/System.err: at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1462) 04-08 17:34:39.596 7599-7617/? W/System.err: at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239) 04-08 17:34:39.789 7599-7617/? I/cocos2d-x debug info: [201.8641] [INFO] luaj.callStaticMethod("com/testgame/utils/PushManager",
//去掉 @Modify 和 @Add 标识后直接调用 04-08 19:04:17.383 10219-10236/? D/MicroMsg.SDK.MMessage: send mm message, intent=Intent { act=com.tencent.mm.plugin.openapi.Intent.ACTION_HANDLE_APP_REGISTER (has extras) }, perm=com.tencent.mm.permission.MM_MESSAGE 04-08 19:04:17.384 10219-10236/? W/System.err: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() 04-08 19:04:17.384 10219-10236/? W/System.err: at android.os.Handler.(Handler.java:200)
04-08 19:04:17.384 10219-10236/? W/System.err: at android.os.Handler.(Handler.java:114)
04-08 19:04:17.384 10219-10236/? W/System.err: at android.widget.Toast$TN.(Toast.java:344)
04-08 19:04:17.384 10219-10236/? W/System.err: at android.widget.Toast.(Toast.java:100)
04-08 19:04:17.384 10219-10236/? W/System.err: at android.widget.Toast.makeText(Toast.java:258)
04-08 19:04:17.384 10219-10236/? W/System.err: at com.testgame.utils.wx.WeixinUtils.addFunc(WeixinUtils.java:160)
04-08 19:04:17.384 10219-10236/? W/System.err: at com.testgame.utils.wx.WeixinUtils.shareImage(WeixinUtils.java:298)
04-08 19:04:17.384 10219-10236/? W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(Native Method)
04-08 19:04:17.384 10219-10236/? W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(Cocos2dxRenderer.java:125)
04-08 19:04:17.384 10219-10236/? W/System.err: at org.cocos2dx.lib.Cocos2dxGLSurfaceView$9.run(Cocos2dxGLSurfaceView.java:261)
04-08 19:04:17.384 10219-10236/? W/System.err: at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1462)
04-08 19:04:17.384 10219-10236/? W/System.err: at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)
// 加载修改过 TencentUtils.java 的补丁 04-08 19:03:02.751 10219-10236/? I/cocos2d-x debug info: [33.2444] [INFO] luaj.callStaticMethod("com/tencent/TencentUtils", "shareImageText", args, "(Ljava/lang/String;I)V" 04-08 19:03:02.756 10219-10236/? D/robust: arrivied in isSupport ::true:1130 paramArrayOfObject [Ljava.lang.Object;@16112aeb 04-08 19:03:02.756 10219-10236/? D/robust: in isSupport assemble method number is 1130 04-08 19:03:02.756 10219-10236/? D/robust: arrivied in isSupport ::true:1130 paramArrayOfObject [Ljava.lang.Object;@16112aeb isSupport result is true 04-08 19:03:02.756 10219-10236/? D/robust: arrivied in AccessDispatch ::true:1130 paramArrayOfObject [Ljava.lang.Object;@3d251048 04-08 19:03:02.756 10219-10236/? D/robust: static method forward 04-08 19:03:02.760 10219-10236/? D/robust: assemble method number is 1130 04-08 19:03:02.760 10219-10236/? D/robust: invoke method is com.meituan.robust.patch.TencentUtilsPatch.shareImageText(java.lang.String,int) 04-08 19:03:02.760 10219-10236/? D/robust: get static value is out No: 61 04-08 19:03:02.761 10219-10236/? I/System.out: QQ 图文分享 04-08 19:03:02.761 10219-10236/? D/robust: get static value is s_instance No: 62 04-08 19:03:02.762 10219-10236/? W/System.err: java.lang.NullPointerException: null receiver 04-08 19:03:02.764 10219-10236/? W/System.err: at java.lang.reflect.Field.get(Native Method) 04-08 19:03:02.764 10219-10236/? W/System.err: at java.lang.reflect.Field.get(Field.java:279) 04-08 19:03:02.764 10219-10236/? W/System.err: at com.meituan.robust.utils.EnhancedRobustUtils.getFieldValue(EnhancedRobustUtils.java:257) 04-08 19:03:02.764 10219-10236/? W/System.err: at com.meituan.robust.patch.TencentUtilsPatch.shareImageText(TencentUtilsPatch.java:55) 04-08 19:03:02.764 10219-10236/? W/System.err: at com.meituan.robust.patch.TencentUtilsPatchControl.accessDispatch(PatchTemplate.java) 04-08 19:03:02.764 10219-10236/? W/System.err: at com.meituan.robust.PatchProxy.accessDispatch(PatchProxy.java:94) 04-08 19:03:02.765 10219-10236/? W/System.err: at com.meituan.robust.PatchProxy.proxy(PatchProxy.java:44) 04-08 19:03:02.765 10219-10236/? W/System.err: at com.tencent.TencentUtils.shareImageText(TencentUtils.java) 04-08 19:03:02.767 10219-10236/? W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(Native Method) 04-08 19:03:02.767 10219-10236/? W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(Cocos2dxRenderer.java:125) 04-08 19:03:02.767 10219-10236/? W/System.err: at org.cocos2dx.lib.Cocos2dxGLSurfaceView$9.run(Cocos2dxGLSurfaceView.java:261) 04-08 19:03:02.767 10219-10236/? W/System.err: at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1462) 04-08 19:03:02.767 10219-10236/? W/System.err: at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239) 04-08 19:03:02.767 10219-10236/? D/robust: get value is m_activity No: 63 04-08 19:03:02.769 10219-10236/? W/System.err: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() 04-08 19:03:02.770 10219-10236/? W/System.err: at android.os.Handler.(Handler.java:200)
04-08 19:03:02.770 10219-10236/? W/System.err: at android.os.Handler.(Handler.java:114)
04-08 19:03:02.770 10219-10236/? W/System.err: at android.widget.Toast$TN.(Toast.java:344)
04-08 19:03:02.770 10219-10236/? W/System.err: at android.widget.Toast.(Toast.java:100)
04-08 19:03:02.770 10219-10236/? W/System.err: at android.widget.Toast.makeText(Toast.java:258)
04-08 19:03:02.770 10219-10236/? W/System.err: at com.meituan.robust.patch.TencentUtilsPatch.shareImageText(TencentUtilsPatch.java:55)
04-08 19:03:02.770 10219-10236/? W/System.err: at com.meituan.robust.patch.TencentUtilsPatchControl.accessDispatch(PatchTemplate.java)
04-08 19:03:02.770 10219-10236/? W/System.err: at com.meituan.robust.PatchProxy.accessDispatch(PatchProxy.java:94)
04-08 19:03:02.770 10219-10236/? W/System.err: at com.meituan.robust.PatchProxy.proxy(PatchProxy.java:44)
04-08 19:03:02.770 10219-10236/? W/System.err: at com.tencent.TencentUtils.shareImageText(TencentUtils.java)
04-08 19:03:02.770 10219-10236/? W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(Native Method)
04-08 19:03:02.770 10219-10236/? W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(Cocos2dxRenderer.java:125)
04-08 19:03:02.770 10219-10236/? W/System.err: at org.cocos2dx.lib.Cocos2dxGLSurfaceView$9.run(Cocos2dxGLSurfaceView.java:261)
04-08 19:03:02.770 10219-10236/? W/System.err: at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1462)
04-08 19:03:02.770 10219-10236/? W/System.err: at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)