由于错误消息表明您不排除META-INF/LICENSE
存在于多个依赖项中的文件
com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:在APK META-INF/LICENSE中复制的重复文件
packagingOptions { exclude 'META-INF/NOTICE' // will not include NOTICE file exclude 'META-INF/LICENSE' // will not include LICENSE file // as noted by @Vishnuvathsan you may also need to include // variations on the file name. It depends on your dependencies. // Some other common variations on notice and license file names exclude 'META-INF/notice' exclude 'META-INF/notice.txt' exclude 'META-INF/license' exclude 'META-INF/license.txt' }