gpt4 book ai didi

android-studio - MPAndroidChart 的 Gradle 依赖项在 Android Studio 中不起作用

转载 作者:行者123 更新时间:2023-12-03 17:43:29 26 4
gpt4 key购买 nike

尝试安装 MPAndroidChart,我尝试按照 Readme 中的说明进行操作用于将库添加为 gradle 依赖项。

编辑:我没有编辑 top-level build.grade file ,只有我的应用目录中的 build.gradle 文件。后者看起来像这样:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
useLibrary 'org.apache.http.legacy'

defaultConfig {
applicationId "com.gmail.konstantin.schubert.workload"
minSdkVersion 16
targetSdkVersion 23
versionCode 7
versionName "1.1.5"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

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

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.guava:guava:17.0'
compile 'joda-time:joda-time:2.8.2'
compile 'com.android.support:design:23.0.0'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.3'
}

如您所见,我在依赖项中添加了maven存储库和编译指令。

但是,Android Studio 给了我一个错误:

Error:(32, 13) Failed to resolve: com.github.PhilJay:MPAndroidChart:v2.2.3

编辑:以下是 JitPack 给出的说明:https://jitpack.io/我相信我已经完全按照他们的要求行事了。

我做错了什么?我忘记了什么?

编辑:这个问题真的是走错了路。查看我的 gradle 日志,我发现了以下错误:

* What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not resolve com.github.PhilJay:MPAndroidChart:v2.2.3.
Required by:
workload:app:unspecified
Could not GET 'https://jitpack.io/com/github/PhilJay/MPAndroidChart/v2.2.3/MPAndroidChart-v2.2.3.pom'.
> peer not authenticated

这是一个更好的线索,可以很容易地用谷歌搜索。

最佳答案

请像这样编辑您的顶级 gradle 文件:

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

其他的..看看android studio右下角的gradle控制台,给我看日志。

关于android-studio - MPAndroidChart 的 Gradle 依赖项在 Android Studio 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36210933/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com