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

来源:互联网 发布:英语同声传译软件 编辑:程序博客网 时间:2024/05/22 02:16

1 .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',monospace,sans-serif; white-space:inherit"><span class="pln" style="color:#000000;margin:0px; padding:0px; border:0px;">android </span><span class="pun" style="color:#000000;margin:0px; padding:0px; border:0px;">{</span><span class="pln" style="color:#000000;margin:0px; padding:0px; border:0px;">    packagingOptions </span><span class="pun" style="color:#000000;margin:0px; padding:0px; border:0px;">{</span><span class="pln" style="color:#000000;margin:0px; padding:0px; border:0px;">    exclude </span><span class="str" style="color:#8000;margin:0px; padding:0px; border:0px;">'META-INF/LICENSE.txt'</span><span class="pln" style="color:#000000;margin:0px; padding:0px; border:0px;">    </span><span class="pun" style="color:#000000;margin:0px; padding:0px; border:0px;">}</span><span class="pln" style="color:#000000;margin:0px; padding:0px; border:0px;"></span><span class="pun" style="color:#000000;margin:0px; padding:0px; border:0px;">}</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. }  


0 0
原创粉丝点击