我想在我的项目中使用MPAndroidChart。
我将这个库添加到我的gradle中,但是在我的xml布局文件中,我找不到图表。
我的build.gradle(模块)是:
dependencies {
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
}
Build.gradle(项目)是:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
但是我在xml布局文件中找不到图表
发布于 2022-02-26 14:26:09
在setting.gradle文件中添加maven { url 'https://jitpack.io' }
而不是build.gradle(项目)
发布于 2022-07-05 08:08:01
需要在setting.gradle中添加maven url,添加这样的代码。
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
https://stackoverflow.com/questions/71267938
复制相似问题