我将最新的Joda Time jar添加到libs文件夹中,并添加了库。当尝试运行时,我得到以下错误:
Error:Execution failed for task ':Selfies:packageDebug'.
> Duplicate files copied in APK META-INF/LICENSE.txt
File 1: C:UsersDominicDesktopselfieappSelfiesSelfieslibscommons-io-2.4.jar
File 2: C:UsersDominicDesktopselfieappSelfiesSelfieslibsjoda-time-2.8.1.jar
不太确定这意味着什么以及如何修复它。任何帮助都太好了!
像这样更新您的build.gradle
:
android {
...
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
您可以在构建中使用packagingOptions排除此文件。但是你也应该看看joda-time-android或者更好的https://github.com/JakeWharton/ThreeTenABP