导入工程后编译不过,报错: apply plugin: 'com.github.dcendents.android-maven'
編譯時報錯:
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' ? // 修改此處
 ? ? }
?
?重新編譯后,不再報錯。
轉載于:https://www.cnblogs.com/zhaoqingyue/p/8867096.html
總結
以上是生活随笔為你收集整理的导入工程后编译不过,报错: apply plugin: 'com.github.dcendents.android-maven'的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: Docker学习笔记
 - 下一篇: 十年老站吐血迁移实录