MPAndroidChart v3.1.0 在 github 上找不到

sti*_*lab 1 java android gradle android-studio mpandroidchart

我正在尝试使用 java 语言在我的 android 应用程序中实现 MPAndroidChart,但是当我同步项目时 Android Studio 返回错误。

找不到 com.github.PhilJay:MPAndroidChart:v3.1.0.Required by: 项目 :app

我已经将依赖项放入我的 build.gradle(app) 文件中,如下所示:

dependencies {
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
}
Run Code Online (Sandbox Code Playgroud)

并添加了存储库:

repositories {
    maven { url 'https://jitpack.io' }
}
Run Code Online (Sandbox Code Playgroud)

我也尝试实施这里提出的所有解决方案,但无法解决。所以我需要帮助,拜托。

sti*_*lab 8

我已经按照该项目的Github 问题中的说明帖子解决了这个问题要解决这个问题,您只需在 settings.gradle 中添加以下代码即可

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        jcenter() // Warning: this repository is going to shut down soon
        maven { url 'https://jitpack.io' } //Add this line in your settings.gradle
    }
}
Run Code Online (Sandbox Code Playgroud)

并且不要忘记在 build.gradle 中实现该库(应用程序级别)

dependencies {
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
}
Run Code Online (Sandbox Code Playgroud)