【问题标题】:Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found错误:(2, 0) 未找到 ID 为“com.github.dcendents.android-maven”的插件
【发布时间】:2015-08-15 06:23:48
【问题描述】:

我使用以下库将材料设计添加到我的 android 项目
https://github.com/navasmdc/MaterialDesignLibrary

但是将其作为模块导入后,出现以下错误。 我该如何解决它

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

【问题讨论】:

    标签: android gradle android-gradle-plugin material-design


    【解决方案1】:

    首先,您可以将此库用作依赖项,只需将这个依赖项添加到您的module/build.gradle:

    dependencies {
        compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
    }
    

    如果你想在本地作为模块导入,你必须在你的module/build.gradle中添加这部分:(这部分是在库中的the top-level file中添加的)

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.+'
            classpath 'org.codehaus.groovy:groovy-backports-compat23:2.3.5'
            classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
            classpath 'com.github.dcendents:android-maven-plugin:1.2'
        }
    }
    

    注意这个库没有用上一个支持库更新,也没有使用新的设计支持库。

    【讨论】:

      【解决方案2】:

      在 project.gradle 依赖项中添加这些行:

          classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
          classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
      

      【讨论】:

        【解决方案3】:

        如果你添加:

        classpath 'com.github.dcendents:android-maven-plugin:1.2'
        

        它有时不起作用,所以添加:

        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
        

        要完成,将以下行添加到导入模块的 build.gradle 文件中。

        buildscript { 
        
            repositories {
                mavenCentral()
                jcenter()
            }
        
            dependencies {
                classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
                classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
            }
        }
        

        享受编码。

        【讨论】:

        • 救了我一整晚 :)
        【解决方案4】:

        在模块依赖中导入@arr文件

        【讨论】:

        • 在模块依赖中没有找到
        • 当需要在jcenrer()下方添加meven center位置时
        • 你可以在这里看到他们的演示项目https://github.com/navasmdc/MaterialDesignLibrary
        • 现在我得到以下错误:'dependencies' cannot be applied to '(groovy.lang.Closure)'
        猜你喜欢
        • 2016-02-12
        • 2017-03-22
        • 2018-04-09
        • 2023-04-10
        • 1970-01-01
        • 1970-01-01
        • 2014-08-03
        • 2014-09-07
        相关资源
        最近更新 更多