我有一个项目依赖于旧Codehaus 1.x.x maven存储库中的Jackson-Core
和Jackson-Mapper
。
但是,当将两个作为库导入时,我收到duplicate files during packaging of APK
错误。
有没有办法解决这个问题?
完整错误:
Error: duplicate files during packaging of APK C:\Users\Tukajo\AndroidStudioProjects\buruburu\app\build\outputs\apk\app-debug-unaligned.apk
Path in archive: META-INF/ASL2.0
Origin 1: C:\Users\USER\AndroidStudioProjects\buruburu\lib\libs\jackson-mapper-asl2-1.9.13.jar
Origin 2: C:\Users\USER\AndroidStudioProjects\buruburu\lib\libs\jackson-core-asl-1.9.13.jar
如果我补充:
packagingOptions {
exclude 'META-INF/ASL2.0'
}
到build.gradle文件...
我收到一个新错误:
> Duplicate files copied in APK META-INF/LICENSE
File 1: C:\Users\USER\AndroidStudioProjects\buruburu\lib\libs\jackson-mapper-asl2-1.9.13.jar
File 2: C:\Users\USER\AndroidStudioProjects\buruburu\lib\libs\jackson-mapper-asl2-1.9.13.jar
答案 0 :(得分:0)
在gradle中像下面那样指导解决了这个问题。这是正确的做法还是推荐的?不确定。
android {
//Other scripts
packagingOptions {
pickFirst "**"
}
}