1. 程式人生 > >Error:(38, 13) Failed to resolve: com.github.PhilJay:MPAndroidChart:v3.0.1

Error:(38, 13) Failed to resolve: com.github.PhilJay:MPAndroidChart:v3.0.1

首先說一下MPAndroidChart,他是一個包含(柱狀圖,折線圖,餅狀圖)的第三方庫,但是今天在使用這個庫的使用出現了一個問題:


解決辦法:在專案的build.grdle中加入

maven { url "https://jitpack.io" }如圖所示
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() //遠端倉庫 gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
} } maven { url "https://github.com/J2W/mvn-repo-j2w/raw/master/repository" } maven { url "https://jitpack.io" } } } task clean(type: Delete) { delete rootProject.buildDir }