Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found解决办法

来源:互联网 发布:网络色情图片和小说 编辑:程序博客网 时间:2024/04/29 02:41
导入开源项目的时候老是报这个错

Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found

       引起这个错误的原因是因为你在,AndroidStudio的model中的(注意是model中的,不是Project中的)build.gradle文件中有一行apply plugin: 'com.github.dcendents.android-maven'而你没有在buildscript中制定这个的位置。所以,你应该到你项目的(也就是Project目录下)找到build.gradle 文件,修改buildscript如下

buildscript {
repositories {
jcenter()
}
dependencies {
//。。。你的其他配置

//添加这行 classpath 'com.github.dcendents:android-maven-plugin:1.2
// NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files
}}
你需要在Project的build.gradle下面(buildscript-dependencies)添加这两个依赖项
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
另外需要注意的是不仅要加这两个,还要保证后面的版本号是对的才行(这个你其实可以在你下载下来的github源项目的配置文件里去找),我之前就是因为把上面两个版本号都写成了1.21.2就都没编译过

参考网址:https://github.com/dcendents/android-maven-gradle-plugin
                 https://github.com/dcendents/android-maven-plugin
                 https://github.com/simpligility/android-maven-plugin
                 http://www.xyczero.com/blog/article/19/


0 0
原创粉丝点击