android - 重复输入错误 - 带有 GSON 的 JSONPath

标签 android json parsing gson jsonpath

我在 GSON 中使用 JSONPATH 库

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

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

Error:Execution failed for task '**:app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/objectweb/asm/AnnotationVisitor.class**" error.

谁能帮我解决这个问题?

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。

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

最佳答案

排除冲突库,例如:

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

关于android - 重复输入错误 - 带有 GSON 的 JSONPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34374213/

相关文章:

android - 为什么文本转语音 (TTS) 不能一直工作?

java - 将自定义 View 添加到 xml 布局

javascript - 使用 JavaScript 解析来自外部站点的 json

parsing - 如何获得粗粒度的词性标签?

java - 如何在 Java 中将带有参数的 uri 解析为 Map

android - Android无法杀死的进程?

java - getDrawingCache() 返回的位图未更新

python - 如何将 GET 请求中的 Json 转换为 pandas 数据帧

javascript - 无法从 json 对象获取数据

c - 在 C 中逐行读取 X&Y 坐标并将它们存储在不同的数组中