Tuesday, July 21, 2015

[Android][Resolved] Error:duplicate files during packaging of APK debug-unaligned.apk

This error message happened during building the project. (Using Android Studio 1.22, JRE:1.7.0-60-b19x86.)

Error Message:

 Error:duplicate files during packaging of APK C:\Documents and Settings\xxxxxxxx\AndroidStudioProjects\project_name\build\outputs\apk\project_name-debug-unaligned.apk

Error:Execution failed for task ':packageDebug'.
> Duplicate files copied in APK META-INF/LICENSE.txt
    File 1: C:\Documents and Settings\xenialaw\AndroidStudioProjects\project_name\libs\httpclient-4.0.1.jar
    File 2: C:\Documents and Settings\xenialaw\AndroidStudioProjects\project_name\libs\twitter4j-core-2.1.11.jar


Add the code at build.gradle, within android tag to ignore those files:

packagingOptions {
    exclude 'META-INF/LICENSE.txt'
}
Example code :



Reference:

No comments :

Post a Comment