编译时报错:

Error:(2, 0) No service of type Factory

apply plugin: 'com.github.dcendents.android-maven'

 

原来是导入工程时修改了根目录下的build.gradle的android gradle版本。

源码gradle版本是1.1.3,导入工程后修改为2.2.2,修改gradle-wrapper的版本为2.14.1。

由于不同的gradle版本需要不同marven-gradle-plugin版本。将版本修改为正确的版本即编译通过。

 

dependencies {
        classpath 'com.android.tools.build:gradle:1.1.3'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
    }

 

dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'   // 修改此处
    }

 

 重新编译后,不再报错。

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-07-01
  • 2021-11-03
猜你喜欢
  • 2022-12-23
  • 2021-05-29
  • 2022-01-03
  • 2022-01-15
  • 2022-01-13
  • 2021-04-11
  • 2022-12-23
相关资源
相似解决方案