【问题标题】:Duplicate entry error - JSONPath with GSON重复输入错误 - 带有 GSON 的 JSONPath
【发布时间】:2015-12-19 18:51:44
【问题描述】:

我正在使用带有 GSON 的 JSONPATH 库

compile 'com.google.code.gson:gson:2.5'
compile 'com.jayway.jsonpath:json-path:2.1.0'

我用过这两个库。当我构建我的项目时,它没有显示任何错误。但是当我运行我的项目时,它会显示

错误:任务“**:app:transformClassesWithJarMergingForDebug”执行失败。

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:org/objectweb/asm/AnnotationVisitor.class**”错误。

谁能帮我解决这个问题?

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
    applicationId ""
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName '0.2'
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}
}


dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.jayway.jsonpath:json-path:2.0.0'

}

这是我的 build.gradle。

问题出在库中。它显示文件的重复条目。

【问题讨论】:

  • 你需要展示一些代码。
  • @Shawn 我已经发布了 build.gradle 文件
  • compile 'com.jayway.jsonpath:json-path:0.9.1' 这个版本的 jsonPath 库解决了这个问题。谁能解释一下为什么?

标签: android json parsing gson jsonpath


【解决方案1】:

排除冲突的库,例如:

compile ('com.jayway.jsonpath:json-path:2.2.0') { exclude group: 'org.ow2.asm' }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-25
    • 2019-03-06
    • 1970-01-01
    • 1970-01-01
    • 2016-03-10
    • 2018-04-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多