gpt4 book ai didi

java - 在模块 graphview 中发现重复的类

转载 作者:行者123 更新时间:2023-12-02 01:22:33 24 4
gpt4 key购买 nike

所以我一直在尝试使用GraphView。我已将其导入到我的依赖项中,但由于某种原因,我收到依赖项解析错误。这是我的 app/build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'android.arch.lifecycle:extensions:1.1.1'
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.getbase:floatingactionbutton:1.10.1'
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'com.jjoe64:graphview:4.2.2'
}

但是当我尝试运行该应用程序时,构建失败并收到以下错误:

"Duplicate class com.jjoe64.graphview.GraphView found in modules GraphView-3.0.jar (GraphView-3.0.jar) and classes.jar (com.jjoe64:graphview:4.2.2)
Duplicate class com.jjoe64.graphview.GraphView$1 found in modules GraphView-3.0.jar (GraphView-3.0.jar) and classes.jar (com.jjoe64:graphview:4.2.2)

转到文档以了解如何修复依赖项解析错误。”

“implementation 'com.android.support:appcompat-v7:28.0.0'”行显示错误,并声称我同时使用版本 28.0.0 和 27.1.1。

我错过了什么?

最佳答案

出现该问题的原因可能是两个库使用相同的类。在本例中,它是 GraphView-3.0.jar。编译器无法选择需要使用哪一个。因此,您可以在其中一个库中删除此 .jar,然后尝试使用它。

否则,您可以只使用支持库 appcompat-v7:27.1.1 的版本,然后两个库将使用相同的版本,不会有任何冲突。

类似的问题和可能的解决方案描述如下:link

关于java - 在模块 graphview 中发现重复的类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57436706/

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