Meituan-Dianping / Robust

Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without a reboot.
Apache License 2.0
4.42k stars 807 forks source link

PatchsInfoImpl failed,cause ofjava.lang.ClassNotFoundException #257

Open jackzjw opened 6 years ago

jackzjw commented 6 years ago

异常类型:PatchesInfoImpl类找不到导致加载失败

手机型号:vivo XPlus9

手机系统版本:如:Android 7.0

Robust版本:0.4.78

Gradle版本:如:4.1

系统:windows

堆栈/日志:

03-30 17:12:30.451 19745-19909/? D/robust: patchManipulate list size is 1 03-30 17:12:30.452 19745-19909/? D/robust: PatchsInfoImpl name:com.meituan.robust.patch.PatchesInfoImpl 03-30 17:12:30.453 19745-19909/? E/robust: PatchsInfoImpl failed,cause ofjava.lang.ClassNotFoundException: Didn't find class "com.meituan.robust.patch.PatchesInfoImpl" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib64, /vendor/lib64]] 03-30 17:12:30.453 19745-19909/? W/System.err: java.lang.ClassNotFoundException: Didn't find class "com.meituan.robust.patch.PatchesInfoImpl" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib64, /vendor/lib64]] 03-30 17:12:30.453 19745-19909/? W/System.err: at com.meituan.robust.PatchExecutor.patch(Unknown Source) 03-30 17:12:30.453 19745-19909/? W/System.err: at com.meituan.robust.PatchExecutor.applyPatchList(Unknown Source) 03-30 17:12:30.453 19745-19909/? W/System.err: at com.meituan.robust.PatchExecutor.run(Unknown Source) 03-30 17:12:30.453 19745-19909/? D/robust: patch LocalPath:/storage/emulated/0/robust/patch.jar,apply result false

确定patch.jar中有PatchesInfoImpl类,而且全路径也是对的,为什么会加载失败?

tanhaoshi commented 6 years ago

异常类型:PatchesInfoImpl类找不到导致加载失败

手机型号:xiaomi 5s

手机系统版本:如:Android 7.0

Robust版本:0.4.78

Gradle版本:如2.14

系统:windows

堆栈/日志:

03-30 17:12:30.451 19745-19909/? D/robust: patchManipulate list size is 1 03-30 17:12:30.452 19745-19909/? D/robust: PatchsInfoImpl name:com.meituan.robust.patch.PatchesInfoImpl 03-30 17:12:30.453 19745-19909/? E/robust: PatchsInfoImpl failed,cause ofjava.lang.ClassNotFoundException: Didn't find class "com.meituan.robust.patch.PatchesInfoImpl" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib64, /vendor/lib64]] 03-30 17:12:30.453 19745-19909/? W/System.err: java.lang.ClassNotFoundException: Didn't find class "com.meituan.robust.patch.PatchesInfoImpl" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib64, /vendor/lib64]] 03-30 17:12:30.453 19745-19909/? W/System.err: at com.meituan.robust.PatchExecutor.patch(Unknown Source) 03-30 17:12:30.453 19745-19909/? W/System.err: at com.meituan.robust.PatchExecutor.applyPatchList(Unknown Source) 03-30 17:12:30.453 19745-19909/? W/System.err: at com.meituan.robust.PatchExecutor.run(Unknown Source) 03-30 17:12:30.453 19745-19909/? D/robust: patch LocalPath:/storage/emulated/0/robust/patch.jar,apply result false

确定patch.jar中有PatchesInfoImpl类,而且全路径也是对的,为什么会加载失败?

tanhaoshi commented 6 years ago

@jackzjw 异常类型:PatchesInfoImpl类找不到导致加载失败。你可以按照Robust作者 wiki里面看下他是怎么做的,我按着他的来,我检查了我生成的patch.jar中的classes.dex里所有的代码,其中我发现了这个类PatchesInfoImpl,你也可以使用jd-gui检查下你生成了这个类了嘛,然而生成了这个类但是我还是没有加载补丁出来,后来我将0.4.7.8的版本改为了最低的一个版本0.3.2 后来加载出来了,其中0.3.3也是加载补丁不出来的。你可以尝试下。

EricYuan1201 commented 6 years ago

相同的问题,华为手机。。。。