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
2019-06-12 17:14:04.876 18797-18797/com.homelink.im W/System.err: java.lang.IllegalArgumentException: method com.homelink.ljpermission.RequestOptions.requestPermissions argument 1 has type java.lang.String[], got java.lang.Object[] #328
Open
android-ext opened 5 years ago
在提交issue之前,我们应该先查询是否已经有相关的issue和ReadMe中的注意事项,比如说Robust在0.3.3版本才支持windows开发。提交issue时,我们需要写明issue的原因,最好可以携带编译或运行过程的日志或者截图。issue最好以下面的格式提出:
异常类型:app运行时异常/编译异常
手机型号:如:Nexus 5(如是编译异常,则可以不填)
手机系统版本:如:Android 5.0 (如是编译异常,则可以不填)
Robust版本:如:0.4.87
Gradle版本:如:2.10
系统:如:Mac
堆栈/日志:
如是编译异常,请在执行gradle命令时,加上--stacktrace,并把结果重定向,例如在demo中重定向命令如下:./gradlew clean assembleRelease --stacktrace --no-daemon >log.txt ,结果重定向到当前的目录下的log.txt文件; 日志中我们需要过滤"robust"关键字,可以初步查找问题的大概原因; Robust提供了sample样例与我们的源码,大家在使用前可以先将样例跑通,如遇任何疑问也欢迎大家提出,更鼓励大家给我们提pr,谢谢大家的支持.
bug堆栈信息: 2019-06-12 17:14:04.876 18797-18797/com.xxx.im W/System.err: java.lang.IllegalArgumentException: method com.xxx.ljpermission.RequestOptions.requestPermissions argument 1 has type java.lang.String[], got java.lang.Object[]
报错的方法 @Override protected void onCreate(@Nullable Bundle savedInstanceState) { PushSdkDependencyImpl.IS_DEAD_PUSH = true; super.onCreate(savedInstanceState); ToastUtilWrapper.toast("aaaaaaaa"); LjPermissionUtil .with(this) .requestPermissions(new String[] { Manifest.permission.READ_PHONE_STATE, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE }) .onCallBack(new LjPermissionUtil.PermissionCallBack() { @Override public void onPermissionResult(List granted, List denied) {
//如果获取到手机信息读取权限,尝试更新 DeviceId
if (granted.contains(Manifest.permission.READ_PHONE_STATE)) {
DeviceUtil.getDeviceIDEx(getApplicationContext());
}
if (denied == null || denied.size() == 0) {
pageJumpLogic();
} else {
showPermissionDialog(denied);
}
}
}).begin();
}
反编译class public Object[] getRealParameter(Object[] objArr) { if (objArr == null || objArr.length < 1) { return objArr; } Object[] objArr2 = new Object[objArr.length]; int i = 0; while (true) { int i2 = i; if (i2 >= objArr.length) { return objArr2; } if (objArr[i2] instanceof Object[]) { objArr2[i2] = getRealParameter((Object[]) objArr[i2]); } else if (objArr[i2] == this) { objArr2[i2] = this.originClass; } else { objArr2[i2] = objArr[i2]; } i = i2 + 1; } }
当我的参数是String数组时, 插入代码后变成了Object数组