Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix Plugin with id 'com.github.dcendents.android-maven' not found. in android studio

I am creating an android application in android studio. I am adding a library to my project which was downloaded from here . When i was adding this library to my project it was showing an error called "Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found.". Please tell me how to fix it.

like image 233
RD Division Medequip Avatar asked Mar 05 '15 06:03

RD Division Medequip


3 Answers

In top level build.gradle dependencies, paste this classpaths. I wonder why cant i've seen this method in websites. Anyway, I fixed it using this way.

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
}
like image 163
Yedam Seong Avatar answered Nov 20 '22 22:11

Yedam Seong


There come two scenarios here:

  1. If you are using apply plugin: 'com.github.dcendents.android-maven' in your module level gradle.

This plugin is generally used to distribute and upload your library project to bintaray.

In this case, all you have to do is make use of correct combinations of gradle plugin and maven-gradle-plugin.

The combination of the following versions is working for me:

Inside project level 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'

and in gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

In module level gradle:apply plugin: 'com.github.dcendents.android-maven'

You can check the compatible versions list from Github

  1. If you are not using it, as it is in your case just remove

    classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
    classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
    

and

apply plugin: com.github.dcendents.android-maven
like image 40
DeltaCap019 Avatar answered Nov 20 '22 22:11

DeltaCap019


Just delete the line "apply plugin: 'android-maven'" in the beginning of build.gradle,

apply plugin: 'com.android.application'
apply plugin: 'android-maven'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

the project doesn't need maven.

like image 10
rome753 Avatar answered Nov 20 '22 23:11

rome753