解析失败:com.github.PhilJay.MPAndroidChart:v2.2.4

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

构建时,Gradle 给了我 Failed to resolve: com.github.PhilJay:MPAndroidChart:v2.2.4 错误。

我已经在 build.gradle 中添加了 jitpack

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        flatDir {
            dirs 'aar'
        }
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

这是基于。我错过了什么?

切换到最新版本:

compile 'com.github.PhilJay:MPAndroidChart:v3.0.0-beta1'

并且始终使用主要来源的信息 - 在这种情况下 MPAndroidChart Github Repo Readme.MD

如果在代理后面,请按如下方式在 gradle.properties 中配置您的代理设置:

systemProp.http.proxyHost=103.7.11.34
systemProp.https.proxyPort=8080
systemProp.https.proxyHost=103.7.11.34
systemProp.http.proxyPort=8080

注意:上面几行中的IP地址和端口要替换为你的代理服务器IP地址(或url)和端口

Did you add the following in your root build.gradle file: if not then add this.

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

并重新启动 Android StudioRebuild 您的项目。

I have faced same problem the problem was solved after restarting android studio --> rebuild project.

Also if not solved with above you may change the version of distributionUrl in gradle-wrapper.properties to the available newest.

请检查您是否在 build.gradle 中添加了以下插件,其中添加了
的依赖项 编译 'com.github.PhilJay:MPAndroidChart:v2.2.4' "apply plugin: 'maven'"