duplicate files during packaging of apk

原创 2016年08月31日 11:46:27

run的时候报错:

1.Error:duplicate files during packaging of APK /home/wigooe/project/winxp_soft/serialzigbee/app/build/outputs/apk/app-debug-unaligned.apk

2.Error:Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK lib/x86/libserial_port.so
      File 1: /home/wigooe/project/winxp_soft/serialzigbee/app/build/intermediates/ndk/debug/lib/x86/libserial_port.so
      File 2: /home/wigooe/project/winxp_soft/serialzigbee/app/src/main/jniLibs/x86/libserial_port.so


这个APP运行的环境是在SDK API 19,JDK=1.7,Android Studio 1.5, gradle 2.4



 在build.gradle文件中添加
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 'lib/x86/libserial_port.so'
    }
}

原因是 新建了个jniLibs文件夹,从Ndk文件夹中复制了 各个平台的.so文件,造成了 重复现象



相关文章推荐

So文件 has text relocations问题

记个问题AS使用so会报这个问题 是因为targetSdkVersion版本的问题 需要修改targetSdkVersion并且假如so是在lib工程中 修改lib工程的targetSdkVersio...

Android中Toolbar的使用 AppCompatActivity必备

我们使用的开发工具是AS,先创建一个项目,名字为Toolbar。一步一步next,最后Finish。AS默认创建的新Activity都是继承AppCompatActivity,所以我们在此基础上来设置...

Android Studio中怎么引用AAR包 以及 引用时出现的问题 (Error:duplicate files during packaging of APK.......)

在AS中引用aar包时出现 "Error:duplicate files during packaging of APK.......", 如何解决 ??...

Android studio编译错误 duplicate files during packaging of APK...error

Information:Gradle tasks [:app:assembleDebug] :app:preBuild :app:compileDebugNdk UP-TO-DATE :app:pre...

导入京东open-api-sdk引发的“duplicate files during packaging of APK”错误

解决京东SDK--open-api-sdk-2.0.jar的导入编译出错,同时解决了另一个引发的问题,“duplicate files during packaging of APK”错误,仅供大家参...

Android Duplicate files copied in APK

今天调试 Android 应用遇到这么个问题: Duplicate files copied in APK META-INF/DEPENDENCIES File 1: httpmime-4.3.2.j...

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

转自:http://blog.csdn.net/ylbf_dev/article/details/50364525 Duplicate files copied in APK META-IN...

Delete Duplicate Files

  • 2012年09月06日 16:54
  • 239KB
  • 下载

Avoiding duplicate symbol errors during linking by removing classes from static libraries

原文链接:http://atnan.com/blog/2012/01/12/avoiding-duplicate-symbol-errors-during-linking-by-removing-cl...

Troubleshooting packaging, deployment, and query of Metro style apps

http://msdn.microsoft.com/en-us/library/windows/desktop/hh973484(v=vs.85).aspx Use these sugg...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:duplicate files during packaging of apk
举报原因:
原因补充:

(最多只允许输入30个字)