Error:Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK META-INF/LICENSEFile 1: C:\Users\DDF\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.2.2\3c8f6018eaa72d43b261181e801e6f8676c16ef6\jackson-databind-2.2.2.jar
File 2: C:\Users\DDF\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.2.2\d20be6a5ddd6f8cfd36ebf6dea329873a1c41f1b\jackson-core-2.2.2.jar
导致这种情况一般是SDK版本过低造成的,通常在导入项目的时候由于SDK版本不同导致出错。
解决方案:设置gradle scripts的内容,如下两个scripts文件,选择build gradle(Module app),打开如下图,在android{.......}块中,添加红框里的内容。
添加的内容如下:
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
然后保存,重新启动程序,即可成功。