目前我在build.gradle上使用这些代码行:
compile 'com.fasterxml.jackson.core:jackson-core:2.7.2' compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.2' compile 'com.fasterxml.jackson.core:jackson-databind:2.7.2'
我唯一需要的是ObjectMapper,我知道它在databind包中.当我在gradle中添加这些行时,我按下同步,一切都正确.
问题是在模拟器上运行项目,Android Studio上的消息显示此错误:
Error:Execution Failed for task
‘:app:transformResourcesWithMergeJavaResForDebug’.com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files
copied in APK Meta-INF/NOTICE File1:
C:\Users\Igor.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.7.2\84ffa765dd258dbab8695963c41308b054f3a1cb\jackson-databind-2.7.2.jar
File2:
C:\Users\Igor.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.7.2\8b8310381b690e317f5f0574e9b2dd7034778b4c\jackson-core-2.7.2.jarcompile 'com.fasterxml.jackson.core:jackson-databind:2.7.2'我尝试了Build – >清理项目并删除.gradle /缓存,也没有幸运.
我不知道这可能是什么.有什么建议 ?