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

插件中使用Robust后无法使用context.getString获取到字符串 #286

Open ljzjohnliu opened 6 years ago

ljzjohnliu commented 6 years ago

在提交issue之前,我们应该先查询是否已经有相关的issue和ReadMe中的注意事项,比如说Robust在0.3.3版本才支持windows开发。提交issue时,我们需要写明issue的原因,最好可以携带编译或运行过程的日志或者截图。issue最好以下面的格式提出:

异常类型:app运行时异常

手机型号:如:华为P20 (其他手机也都出现了 应该跟机型无关)

手机系统版本:如:Android 8.1

Robust版本:如:0.4.82

Gradle版本:如:2.2.2

系统:如:ubuntu

我们是把Robust使用在插件中的,不是真正独立的apk,使用后,能正常编译出patch文件,也能加载patch,并且也能修复相关代码,出现了负面影响 表现是mContext.getString(R.string.launch_privilege_receive_fail_content)通过这种方式获取的字符串为null 加载patch之前正常 打印了mContext的信息如下截图

patch patch

从日志看mContext的信息都一致,为啥加载patch后获取不到string了? 求大佬帮忙看看~

luyaotree commented 3 years ago

可能是由于需要修复的APK包的R文件和你本地打包的R文件,对应的launch_privilege_receive_fail_content的数值不同,导致获取到的对应字符串为空