我在 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/