log日志
Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'com.android.build.gradle.internal.scope.BuildArtifactsHolder$FinalBuildableArtifact@706a1c7b' with class
'com.android.build.gradle.internal.scope.BuildArtifactsHolder$FinalBuildableArtifact' to class 'org.gradle.api.file.FileCollection'
at robust.gradle.plugin.RobustApkHashAction$_execute_closure1$_closure2.doCall(RobustApkHashAction.groovy:34)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:739)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:712)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
robust.gradle.plugin.RobustApkHashAction.groovy类中有个判断gradle版本号的方法, 该方法有bug,在判断‘4.10.1’和‘4.6.0’哪个大时,返回‘4.6.0’大,字符串不能那样比较,以下是方法原型: public static boolean isGradlePlugin320orAbove(Project project) { //gradlePlugin3.2.0 -> gradle 4.6+ //see https://developer.android.com/studio/releases/gradle-plugin return project.getGradle().gradleVersion >= "4.6" }
log日志 Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'com.android.build.gradle.internal.scope.BuildArtifactsHolder$FinalBuildableArtifact@706a1c7b' with class 'com.android.build.gradle.internal.scope.BuildArtifactsHolder$FinalBuildableArtifact' to class 'org.gradle.api.file.FileCollection' at robust.gradle.plugin.RobustApkHashAction$_execute_closure1$_closure2.doCall(RobustApkHashAction.groovy:34) at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:739) at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:712) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)