码迷,mamicode.com
首页 > 移动开发 > 详细

android重复的文件复制APK META-INF许可证错误记录

时间:2016-02-18 16:20:12      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:

* What went wrong:
Execution failed for task ‘:app:transformResourcesWithMergeJavaResForDebug‘.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
File1: C:\AndroidStudio\Umer_Doctor\app\libs\httpmime-4.3.5.jar
File2: C:\AndroidStudio\Umer_Doctor\app\libs\httpcore-4.3.2.jar


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

 

这个是当时抛出的异常信息,很奇怪,下面是解决方案(如果有更了解的人欢迎详细解说下,互相学习)

技术分享
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‘
    }
View Code

这个是完整的解决方案,虽然我不知道这是什么原因,估计是编译器的问题,说不定以后as升级了不会发生,我用的是1.5版本的

技术分享

android重复的文件复制APK META-INF许可证错误记录

标签:

原文地址:http://www.cnblogs.com/LiuZhen/p/5198523.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!