Android(安卓)Studio 编译问题(1)
Error: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.txt
File1: C:\Users\huangjie\StudioProjects\TestLean\app\libs\fastjson.jar
File2: C:\Users\huangjie\StudioProjects\TestLean\app\libs\httpmime-4.2.4.jar
意思是不同jar包间存在重复的文件,添加以下常见忽略配置于build.gradle
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’
}
更多相关文章
- Android.mk添加第三方jar包
- 利用ContentProvider的添加数据
- Activity的使用(九): 读取联系人
- RecyclerView添加行间距
- 异常ExceptionInInitializerError解决方案
- Android(安卓)程序奔溃常见问题汇总
- okhttp http 重定向到https
- Android底层知识Window和WindowManager深入分析
- android中添加通过内容提供者添加联系人