
Error: duplicate files during packaging of APK
coding二月 04, 20151mins
Android 经验错误
错误H1
Android项目构建时报如下错
bash
Error: duplicate files during packaging of APK /Users/snowblink/workspace/NoodlesMobile/app-stu/build/outputs/apk/xxx-debug-unaligned.apk
原因H1
打包apk文件时,资源文件冲突。
解决H1
MavenH2
bash
<plugin><groupId>com.jayway.maven.plugins.android.generation2</groupId><artifactId>android-maven-plugin</artifactId><extensions>true</extensions><configuration><extractDuplicates>true</extractDuplicates></configuration></plugin>
GradleH2
bash
packagingOptions {exclude 'META-INF/notice.txt'}
总结H1
Android官方文档对构建过程中打包apk的描述
All non-compiled resources (such as images), compiled resources, and the .dex files are sent to the apkbuilder tool to be packaged into an .apk file.
打包apk的过程中构建工具会把所有资源文件拷贝到apk文件中,文件冲突即会报错
评论
新的评论
上一篇
Guice Account Scope
Google Guice 支持自定义Scope,当然通常情况下我们不需要自己实现Scope。RoboGuice作为Android的IOC容器,实现了基于当前Context的ContextScope。我们可以根据自己需求自定义Scope,实现一些特殊的需求。GitHub的Andr…
下一篇
spring-android-auth ClientHttpRequest
问题 使用spring-android-auth时,其使用的 RestTemplate 是依赖包 spring-android-rest-template 中的,而是spring-web-mvc中的。该 RestTemplate 使用http request默认的逻辑如下 使用…
