Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.
like image 622
Borja Avatar asked Nov 11 '15 16:11

Borja


2 Answers

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.

like image 165
Gabriele Mariotti Avatar answered Nov 17 '22 07:11

Gabriele Mariotti


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".

like image 6
Naveen Kumar M Avatar answered Nov 17 '22 07:11

Naveen Kumar M