gpt4 book ai didi

java - MPAndroidChart 饼图

转载 作者:行者123 更新时间:2023-11-30 02:25:57 25 4
gpt4 key购买 nike

在我的项目中,使用库 MaterialDesign .当我还添加库 MPchart 时,出现此错误并且不明白出了什么问题。谢谢你

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/nineoldandroids/animation/Animator$AnimatorListener;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)

MaterialDesign库的build.gradle:

dependencies {
compile 'com.nineoldandroids:library:2.4.+'
compile 'com.android.support:support-v4:21.0.3'
}

和项目的build.gradle:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.nineoldandroids:library:2.4.+'
compile project(":MaterialDesign")
compile project(":MPChartLib")
compile files('libs/opencsv-2.4.jar')
}.

如果删除依赖项,则会出现其他错误。我能做什么?

最佳答案

您似乎在 MPChartLib 和您的项目中都声明了依赖项 com.nineoldandroids:library:2.4.+。这就是导致问题的原因。

尝试从您的项目中删除依赖项,但将其保留在 MPChartLib 中,以便 dextool 只看到它一次。你的新 build.gradle 看起来像这样:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile project(":MaterialDesign")
compile project(":MPChartLib")
compile files('libs/opencsv-2.4.jar')

也对 Android 支持库执行相同的操作。它应该只声明一次,否则你会得到类似的错误。

关于java - MPAndroidChart 饼图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27912975/

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