studio 编译错误记录

来源:互联网 发布:手机新浪微博域名修改 编辑:程序博客网 时间:2024/06/04 18:02
Error: duplicate files during packaging of APK E:\**\**\app-debug-unaligned.apk
Path in archive: META-INF/LICENSE.txt
Origin 1: E:\**\**\app\libs\httpmime-4.1.2.jar
Origin 2: E:\**\**\app\libs\commons-lang-2.6.jar
You can ignore those files in your build.gradle:
android {
 packagingOptions {
   exclude 'META-INF/LICENSE.txt'
 }
}

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK META-INF/LICENSE.txt
File 1: E:\**\**\app\libs\httpmime-4.1.2.jar
File 2: E:\**\**\app\libs\httpmime-4.1.2.jar

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


从Eclipse 中迁移的一个项目,运行就报这个错误,网上查询后得到解决方法。在 app 项目的 build.gradle 中添加

packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }


0 0
原创粉丝点击