'Error:Plugin with id 'com.github.dcendents.android-maven' not found

I'm using this library in my Android app. (https://github.com/yazeed44/MultiImagePicker)

Before now, I was adding it to my project this way:

compile 'net.yazeed44.imagepicker:imagepicker:1.3.0'

The problem with importing it that way is, as far as I know, that I can't override any code because I'll lose all the changes after building the project again. (I need to change some code)

For that reason, I have downloaded the source code and I've imported the project as a module with this name: 'imagepicker'

After that, I added this line to my app build.gradle:

compile project(':imagepicker')

and this to my settings.gradle (Android Studio did it)

include ':app', ':imagepicker'

After doing that, I try to run the project and Android studio shows this error:

Gradle 'Project' project refresh failed
Error:Plugin with id 'com.github.dcendents.android-maven' not found.


Solution 1:[1]

Since you are using the module locally you have to add in your top-level build.gradle or in the imagepicker/build.gradle same config added in the imagepicker build.gradle project.

buildscript {
    repositories {
        jcenter()
    }

    dependencies {

        //ADD THESE DEPENDENCIES
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
    }
}

An alternative can be modify the imagepicker/build.gradle removing the last 2 lines. But you have to test this way.

apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'

If you check these files you will find the

apply plugin: 'com.github.dcendents.android-maven'

In your case you don't need these files because they are useful only to uplaod in a maven repo the aar file.

Solution 2:[2]

I added below code in Project:gradle.build file and its resolved the problem :

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://repo.commonsware.com.s3.amazonaws.com"
        }
    }
   } 

EDIT

If you still facing after adding above maven dependencies Change url "https://repo.commonsware.com.s3.amazonaws.com" to url "https://s3.amazonaws.com/repo.commonsware.com".

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gabriele Mariotti
Solution 2