// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.meituan.robust:gradle-plugin:0.4.99'
classpath 'com.meituan.robust:auto-patch-plugin:0.4.99'
}
系统:Windows
堆栈/日志:Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'task ':app:packageR
elease' property 'resourceFiles'' with class 'org.gradle.api.internal.file.DefaultFilePropertyFactory$DefaultDir
ectoryVar' to class 'java.io.File'
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/6.5/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
Task :app:transformClassesWithRobustForRelease
================robust start================
read all class file cost 0.249 second
===robust print id start===
key is com.meituan.sample.MainActivity.onCreate(android.os.Bundle) value is 1
key is com.meituan.sample.MainActivity.isGrantSDCardReadPermission() value is 2
key is com.meituan.sample.MainActivity.requestPermission() value is 3
key is com.meituan.sample.MainActivity.onRequestPermissionsResult(int,java.lang.String[],int[]) value is 4
key is com.meituan.sample.MainActivity.handlePermissionResult() value is 5
key is com.meituan.sample.MainActivity.runRobust() value is 6
key is com.meituan.sample.MainActivity.access$000(com.meituan.sample.MainActivity) value is 7
key is com.meituan.sample.MainActivity.access$100(com.meituan.sample.MainActivity) value is 8
key is com.meituan.sample.MainActivity.access$200(com.meituan.sample.MainActivity) value is 9
key is com.meituan.sample.MainActivity$1.onClick(android.view.View) value is 10
key is com.meituan.sample.MainActivity$2.onClick(android.view.View) value is 11
key is com.meituan.sample.MainActivity$3.onClick(android.view.View) value is 12
key is com.meituan.sample.PatchManipulateImp.fetchPatchList(android.content.Context) value is 13
key is com.meituan.sample.PatchManipulateImp.verifyPatch(android.content.Context,com.meituan.robust.Patch) value is 14
key is com.meituan.sample.PatchManipulateImp.copy(java.lang.String,java.lang.String) value is 15
key is com.meituan.sample.PermissionUtils.checkSelfPermission(android.content.Context,java.lang.String) value is 16
key is com.meituan.sample.PermissionUtils.isGrantSDCardReadPermission(android.content.Context) value is 17
key is com.meituan.sample.PermissionUtils.requestSDCardReadPermission(android.app.Activity,int) value is 18
key is com.meituan.sample.RobustCallBackSample.onPatchListFetched(boolean,boolean,java.util.List) value is 19
key is com.meituan.sample.RobustCallBackSample.onPatchFetched(boolean,boolean,com.meituan.robust.Patch) value is 20
key is com.meituan.sample.RobustCallBackSample.onPatchApplied(boolean,com.meituan.robust.Patch) value is 21
key is com.meituan.sample.RobustCallBackSample.logNotify(java.lang.String,java.lang.String) value is 22
key is com.meituan.sample.RobustCallBackSample.exceptionNotify(java.lang.Throwable,java.lang.String) value is 23
key is com.meituan.sample.SecondActivity.onCreate(android.os.Bundle) value is 24
key is com.meituan.sample.SecondActivity.getTextInfo() value is 25
key is com.meituan.sample.SecondActivity.onCreateView(java.lang.String,android.content.Context,android.util.AttributeSet) value is 26
key is com.meituan.sample.SecondActivity.onClick(android.view.View) value is 27
key is com.meituan.sample.SecondActivity.getReflectField(java.lang.String,java.lang.Object) value is 28
key is com.meituan.sample.SecondActivity.getFieldValue(java.lang.String,java.lang.Object) value is 29
key is com.meituan.sample.SecondActivity.printLog(java.lang.String,java.lang.String[][]) value is 30
key is com.meituan.sample.SecondActivity.lambda$onCreate$0(android.view.View) value is 31
===robust print id end===
robust cost 2.705 second
================robust end================
在提交issue之前,我们应该先查询是否已经有相关的issue和ReadMe中的注意事项,比如说Robust在0.3.3版本才支持windows开发。提交issue时,我们需要写明issue的原因,最好可以携带编译或运行过程的日志或者截图。issue最好以下面的格式提出:
异常类型:编译异常
手机型号:编译异常
手机系统版本:编译异常
Robust版本:0.4.99
Gradle版本:6.5 dependencies { classpath "com.android.tools.build:gradle:4.1.0"
系统:Windows
堆栈/日志:Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'task ':app:packageR elease' property 'resourceFiles'' with class 'org.gradle.api.internal.file.DefaultFilePropertyFactory$DefaultDir ectoryVar' to class 'java.io.File'
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/6.5/userguide/gradle_daemon.html. Daemon will be stopped at the end of the build stopping after processing
如是编译异常,请在执行gradle命令时,加上--stacktrace,并把结果重定向,例如在demo中重定向命令如下:./gradlew clean assembleRelease --stacktrace --no-daemon >log.txt ,结果重定向到当前的目录下的log.txt文件; 日志中我们需要过滤"robust"关键字,可以初步查找问题的大概原因; Robust提供了sample样例与我们的源码,大家在使用前可以先将样例跑通,如遇任何疑问也欢迎大家提出,更鼓励大家给我们提pr,谢谢大家的支持.