Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to resolve: com.github.PhilJay:MPAndroidChart:v2.1.4

I'm using MPAndroidChart library in android studio. But when I'm trying to sync gradle I get an error as shown in below image.

Gradle text is here to compile MPAndroidChart library.

compile 'com.github.PhilJay:MPAndroidChart:v2.1.4'

Error screenshot

How can I resolve this problem?

like image 722
pRaNaY Avatar asked Sep 22 '15 13:09

pRaNaY


4 Answers

Add

maven { url "https://jitpack.io" }

to repositories under allprojects not under buildscript see screenshot:

enter image description here

like image 60
Maher Abuthraa Avatar answered Oct 20 '22 15:10

Maher Abuthraa


Above solutions did not work for me. I used below to get MPAndroidChart lib working on my project.

  1. Downloaded the latest MPAndroidChart jar from: https://jitpack.io/com/github/PhilJay/MPAndroidChart/v3.0.1/MPAndroidChart-v3.0.1.jar

  2. Copied the downloaded MPAndroidChart-v3.0.1.jar file to YourProject/app/lib directory

  3. Compiled the following dependency at app level build.gradle

    dependencies {
    
        compile files('libs/MPAndroidChart-v3.0.1.jar')
    
    }
    
  4. re-sync the gradle

like image 19
Nafeez Quraishi Avatar answered Oct 20 '22 14:10

Nafeez Quraishi


Putting

repositories {
    maven { url "https://jitpack.io" }
}

in build.gradle in app folder fixed my issue!

like image 13
Sudheesh Mohan Avatar answered Oct 20 '22 14:10

Sudheesh Mohan


Go to build.gradle Add the maven { url 'https://jitpack.io' } in both buildscript{} and allprojects{} as below :

buildscript {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}



allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Remember to Sync.

like image 13
Niamatullah Bakhshi Avatar answered Oct 20 '22 14:10

Niamatullah Bakhshi