无法应用插件[id' org.gradle.checkstyle']?

时间:2018-04-10 04:56:43

标签: android-studio android-gradle shopify-app

如何解决此错误?

错误:(24,1)评估根项目' myproject10'时出现问题。

  

无法应用插件[id' org.gradle.checkstyle']   无法使用TaskExecutionServices.createFileSnapshotter()创建CachingFileHasher类型的服务。

subprojects {
  def projectName = it.name

  if (projectName != "graphql-java-support") {
    apply from: "../gradle/dependencies.gradle"
  }

  buildscript {
    System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
    repositories {
      jcenter()
      maven { url "https://jitpack.io" }
      maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
  }

  repositories {
    jcenter()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    maven { url 'https://maven.google.com' }
  }

  if (projectName != "graphql-java-support") {
    apply plugin: 'checkstyle'

    checkstyle {
      toolVersion = "5.9"
      configFile rootProject.file('checkstyle.xml')
      configProperties = ['checkstyle.cache.file': rootProject.file('build/checkstyle.cache')]
      ignoreFailures false
      showViolations true
    }

    task checkstyle(type: Checkstyle) {
      source 'src/main/java'
      include '**/*.java'
      classpath = files()
    }

    afterEvaluate {
      if (project.tasks.findByName('check')) {
        check.dependsOn('checkstyle')
      }
    }
  }
}

project.ext.preDexLibs = !project.hasProperty('disablePreDex')

subprojects {
  project.plugins.whenPluginAdded { plugin ->
    if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
      project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
    } else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
      project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
    }
  }
}

0 个答案:

没有答案