我正在android studio中创建一个android应用程序。我正在向我的项目中添加一个库,该库是从here下载的。当我将这个库添加到我的项目中时,它显示了一个名为的错误“error:(2,0) Plugin with id 'com.github.dcendents.android-maven‘not found."。请告诉我怎么修。
发布于 2015-08-02 15:34:42
在顶级build.gradle依赖项中,粘贴以下类路径。我想知道为什么我不能在网站上看到这种方法。不管怎样,我用这种方式修复了它。
dependencies {
//YOUR DEPEDENCIES
classpath 'com.github.dcendents:android-maven-plugin:1.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
发布于 2017-03-07 18:13:59
这里有两个场景:
如果您在模块级gradle中使用apply plugin: 'com.github.dcendents.android-maven'
,请使用
此插件通常用于将您的库项目分发和上传到bintaray。
在这种情况下,您所要做的就是使用gradle插件和maven-gradle-plugin.的正确组合
以下版本的组合对我来说是有效的:
项目级gradle内部
classpath 'com.android.tools.build:gradle:2.3.0+'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
在gradle-wrapper.properties中
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
在模块级gradle中:apply plugin: 'com.github.dcendents.android-maven'
您可以从Github查看兼容版本列表
类路径'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0‘类路径'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
和
apply plugin: com.github.dcendents.android-maven
发布于 2015-11-07 21:22:57
只需删除build.gradle开头的“应用插件:'android-maven'”行即可。
apply plugin: 'com.android.application'
apply plugin: 'android-maven'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
这个项目不需要maven。
https://stackoverflow.com/questions/28871084
复制相似问题