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

Add

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

to repositories under allprojects not under buildscript see screenshot:

enter image description here


Putting

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

in build.gradle in app folder fixed my issue!


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.