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
}


你可能感兴趣的:(Andoid异常)