Duplicate files copied in APK META-INF/DEPENDENCIES File
2017-07-19 09:03
447 查看
今天调试 Android 应用遇到这么个问题:
Duplicate files copied in APK META-INF/DEPENDENCIES File 1: httpmime-4.3.2.jar File 2: httpmime-4.3.2.jar
貌似说两个包里面的文件重复了还是怎么的,谷歌了一番之后据说应该是 android studio 自身的bug
解决办法:
打开项目下面的 build.gradle 文件,在 android 代码块中添加下面代码
[sql] view plain copy print?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
Duplicate files copied in APK META-INF/DEPENDENCIES File 1: httpmime-4.3.2.jar File 2: httpmime-4.3.2.jar
貌似说两个包里面的文件重复了还是怎么的,谷歌了一番之后据说应该是 android studio 自身的bug
解决办法:
打开项目下面的 build.gradle 文件,在 android 代码块中添加下面代码
[sql] view plain copy print?android {
packagingOptions {
exclude ’META-INF/DEPENDENCIES’
exclude ’META-INF/NOTICE’
exclude ’META-INF/LICENSE’
exclude ’META-INF/LICENSE.txt’
exclude ’META-INF/NOTICE.txt’
}
}
android { 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' exclude 'META-INF/ASL2.0' } }
将这些文件全部排出掉就ok了
但不知道这么做会不会有什么隐患,还是有其他更好的解决办法
可以参考下这篇文章:http://stackoverflow.com/questions/20853094/gradle-and-android-studio-duplicate-file-copied-from-same-jar
相关文章推荐
- Android之android studio如何解决':app:packageDebug'.(Duplicate files copied in APK META-INF/DEPENDENCIES)
- com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
- DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
- Duplicate files copied in APK META-INF/DEPENDENCIES
- com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
- com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
- Duplicate files copied in APK META-INF/DEPENDENCIES
- Duplicate files copied in APK META-INF/DEPENDENCIES
- 18、DuplicateFileException: Duplicate files copied in APK META-INF/INDEX.LIST
- Duplicate files copied in APK META-INF/DEPENDENCIES
- com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/DEPENDE
- com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
- com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/NOTICE
- com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
- Duplicate files copied in APK META-INF/DEPENDENCIES 解决办法
- com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/NOTICE
- Duplicate files copied in APK META-INF/rxjava.properties
- Duplicate files copied in APK META-INF/LICENSE.txt
- android studio报错DuplicateFileException: Duplicate files copied in APK META-INF/NOTICE.txt
- Android学习笔记--遇到Duplicate files copied in APK META-INF/LICENSE.txt