lixplor / android-Q-A

🐞 android related questions and answers
0 stars 0 forks source link

Duplicate files copied in APK META-INF/DEPENDENCIES File 1: httpmime-4.3.2.jar File 2: httpmime-4.3.2.jar #7

Closed lixplor closed 7 years ago

lixplor commented 7 years ago

Duplicate files copied in APK META-INF/DEPENDENCIES File 1: httpmime-4.3.2.jar File 2: httpmime-4.3.2.jar

lixplor commented 7 years ago

原因: 貌似说两个包里面的文件重复了还是怎么的,谷歌了一番之后据说应该是 android studio 自身的bug 解决办法: 打开项目下面的 build.gradle 文件,在 android 代码块中添加下面代码


android {

      packagingOptions {

          exclude 'META-INF/DEPENDENCIES'

          exclude 'META-INF/NOTICE'

          exclude 'META-INF/LICENSE'

          exclude 'META-INF/LICENSE.txt'

          exclude 'META-INF/NOTICE.txt'

      }

}  

将这些文件全部排出掉就ok了 http://stackoverflow.com/questions/20853094/gradle-and-android-studio-duplicate-file-copied-from-same-jar