gpt4 book ai didi

android - com.github.PhilJay :MPAndroidChart library 的问题

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

嗨,我的 com.github.PhilJay:MPAndroidChart 库有问题,我想在同步项目时添加到项目中,一切正常,但是当我编译项目时出现此错误,我不知道为什么。

问题说:More than one file was found with OS independent path 'META-INF/proguard/androidx-annotations.pro'
它认为我把所有东西都放在了正确的地方

build.gradle(模块应用程序)

    apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "company.eduardo.administradorfinanzas"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

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

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'


implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'android.arch.persistence.room:runtime:1.1.1'
annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'

// Room components
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
androidTestImplementation "android.arch.persistence.room:testing:$rootProject.roomVersion"

// Lifecycle components
implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion"
annotationProcessor "android.arch.lifecycle:compiler:$rootProject.archLifecycleVersion"
}
apply plugin: 'com.google.gms.google-services'

还有我的 build.gradle(项目)
    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.1'

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

allprojects {
repositories {
google()
jcenter()
}
}

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

ext {
roomVersion = '1.1.1'
archLifecycleVersion = '1.1.1'
}

最佳答案

要么使用 stable version :

dependencies {
// implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.github.PhilJay:MPAndroidChart:v3.0.2"
}

或限制重复 androidx-annotations.pro一个条目:
android {
packagingOptions {
pickFirst "META-INF/proguard/androidx-annotations.pro"
}
}

另请查看 libs目录,如果不是,则重复条目源自 *.jar , 因为文件 androidx-annotations.pro听起来好像它是一个 ProGuard 消费者规则文件,因为它通常由库提供。和 google-services插件当前版本为 4.1.0 .

关于android - com.github.PhilJay :MPAndroidChart library 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53251141/

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