I have found this error when running my app,and I tried some solutions for this problem.But it is not solved my problem.
I have added these lines to my build.gradle file
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENCE'
}
But still there is same errors. Error log
Error:duplicate files during packaging of APK I:\CameraPhotoVideoUpload\app\build\outputs\apk\app-debug-unaligned.apk
Path in archive: META-INF/LICENSE
Origin 1: I:\CameraPhotoVideoUpload\app\libs\httpmime-4.3.6.jar
Origin 2: I:\CameraPhotoVideoUpload\app\libs\httpclient-4.3.6.jar
You can ignore those files in your build.gradle:
android {
packagingOptions {
exclude 'META-INF/LICENSE'
}
}
Error:Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK META-INF/LICENSE
File 1: I:\CameraPhotoVideoUpload\app\libs\httpmime-4.3.6.jar
File 2: I:\CameraPhotoVideoUpload\app\libs\httpclient-4.3.6.jar
Information:BUILD FAILED
I could not understand the problem .Can anyone help??
Gradle file
apply plugin: 'com.android.application'
android {
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENCE'
}
compileSdkVersion 21
buildToolsVersion "23.0.0 rc2"
defaultConfig {
applicationId "info.androidhive.camerafileupload"
minSdkVersion 11
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dependencies {
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile files('libs/httpclient-4.3.6.jar')
compile files('libs/httpcore-4.3.3.jar')
compile files('libs/httpmime-4.3.6.jar')
}
}