diff --git a/src/main/groovy/ru/vyarus/gradle/plugin/animalsniffer/AnimalSnifferPlugin.groovy b/src/main/groovy/ru/vyarus/gradle/plugin/animalsniffer/AnimalSnifferPlugin.groovy index 27c17a8..b1f6b45 100644 --- a/src/main/groovy/ru/vyarus/gradle/plugin/animalsniffer/AnimalSnifferPlugin.groovy +++ b/src/main/groovy/ru/vyarus/gradle/plugin/animalsniffer/AnimalSnifferPlugin.groovy @@ -196,8 +196,10 @@ class AnimalSnifferPlugin implements Plugin { @CompileStatic(TypeCheckingMode.SKIP) private TaskProvider createAndroidClassesCollector(String taskName, Object variant) { TaskProvider collectClasses = project.tasks.register(taskName, AndroidClassesCollector) - variant.artifacts.forScope(com.android.build.api.variant.ScopedArtifacts.Scope.PROJECT).use(collectClasses) - .toGet(com.android.build.api.artifact.ScopedArtifact.CLASSES.INSTANCE, new Function1>() { + def scopedArtifactsScopeType = Class.forName("com.android.build.api.variant.ScopedArtifacts\$Scope") + def scopedArtifactTypeClasses = Class.forName("com.android.build.api.artifact.ScopedArtifact\$CLASSES") + variant.artifacts.forScope(scopedArtifactsScopeType.PROJECT).use(collectClasses) + .toGet(scopedArtifactTypeClasses.INSTANCE, new Function1>() { @Override ListProperty invoke(AndroidClassesCollector task) { return task.jarFiles