Android Studio 错误 Duplicate files copied in APK META-INF/LICENSE.txt解决方案

简介: <code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New',
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">android </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">{</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">

    packagingOptions </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">{</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">
    exclude </span><span class="str" style="margin: 0px; padding: 0px; border: 0px; color: rgb(128, 0, 0);">'META-INF/LICENSE.txt'</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">
    </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">}</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">
</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">}</span></code>

My logcat: log Execution failed for task ':Prog:packageDebug'.

Duplicate files copied in APK META-INF/LICENSE.txt File 1: /home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar File 2: /home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar

 解决方法:
[java]  view plain  copy
  1. android {  
  2.       
  3.   
  4.     packagingOptions {  
  5.         exclude 'META-INF/DEPENDENCIES.txt'  
  6.         exclude 'META-INF/LICENSE.txt'  
  7.         exclude 'META-INF/NOTICE.txt'  
  8.         exclude 'META-INF/NOTICE'  
  9.         exclude 'META-INF/LICENSE'  
  10.         exclude 'META-INF/DEPENDENCIES'  
  11.         exclude 'META-INF/notice.txt'  
  12.         exclude 'META-INF/license.txt'  
  13.         exclude 'META-INF/dependencies.txt'  
  14.         exclude 'META-INF/LGPL2.1'  
  15.     }  
  16. }  


赞一下 :
目录
相关文章
|
4月前
|
开发工具 Android开发
Android项目 Duplicate class
同时接入基础版短视频SDK跟播放器SDK出现Duplicate class
87 1
|
XML Java Android开发
Android Studio开发APP启动程序时开屏简单动画效果快速有效解决方案
Android Studio开发APP启动程序时开屏简单动画效果快速有效解决方案
1337 0
Android Studio开发APP启动程序时开屏简单动画效果快速有效解决方案
|
4天前
|
安全 编译器 API
Android HAL深入探索(5): 调试HAL报错与解决方案
Android HAL深入探索(5): 调试HAL报错与解决方案
6 1
|
1月前
|
JSON Android开发 数据格式
android 使用GSON 序列化对象出现字段被优化问题解决方案
android 使用GSON 序列化对象出现字段被优化问题解决方案
|
8月前
|
IDE Java 开发工具
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8的解决方案
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8的解决方案
|
7月前
|
Android开发
Android Studio 控制台中文乱码,解决方案都在这里了,完美解决
Android Studio 控制台中文乱码,解决方案都在这里了,完美解决
|
8月前
|
Android开发
Android 中ViewPager嵌套RecyclerView出现滑动冲突的解决方案
Android 中ViewPager嵌套RecyclerView出现滑动冲突的解决方案
706 0
|
8月前
|
Android开发
Android > Project with path ‘:audiovisualize‘ could not be found in project ‘:app‘. 异常解决方案
Android > Project with path ‘:audiovisualize‘ could not be found in project ‘:app‘. 异常解决方案
42 0
|
9月前
|
网络协议 Linux Android开发
Android部分手机4G网第一次请求很慢(wifi正常)解决方案
Android部分手机4G网第一次请求很慢(wifi正常)解决方案
256 0
|
10月前
|
Android开发 C++
Android 6.0以上手机报 so: has text relocations 问题的终极解决方案
Android 6.0以上手机报 so: has text relocations 问题的终极解决方案