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
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章