java – Android Studio 1.0.1在APK META-INF / DEPENDENCIES中复制的重复文件

前端之家收集整理的这篇文章主要介绍了java – Android Studio 1.0.1在APK META-INF / DEPENDENCIES中复制的重复文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我安装了Android Studio版本1.0.1,并尝试从eclipse导入我的项目,它给了我以下错误

 Error:Execution Failed for task ':app:packageDebug'.
 Duplicate files copied in APK Meta-INF/DEPENDENCIES
 File 1: E:\app3\app\libs\httpmime-4.3.jar
 File 2: E:\app3\app\libs\httpmime-4.3.jar``

我试图导入我的项目,使用转换jar选项gradle并且不转换它们
搜索了很多并在网上尝试了解决方案但也没有用
这是我的项目的build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion“20.0.0”

defaultConfig {
    applicationId "com.FluoraPin.androidApp"
    minSdkVersion 14
    targetSdkVersion 21
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.txt'
    }
}
}

    android {
    packagingOptions {
        exclude 'Meta-INF/NOTICE'
    }
}

dependencies {
    compile project(':beyondAR_Framework')
    compile project(':facebookSDK')
    compile project(':volley')
    compile 'com.android.support:support-v4:20.0.0'
    compile 'com.android.support:appcompat-v7:19.1.0'
    compile files('libs/commons-logging-1.1.3.jar')
    compile files('libs/httpclient-4.3.6.jar')
    compile files('libs/httpclient-cache-4.3.6.jar')
    compile files('libs/httpcore-4.3.3.jar')
    compile files('libs/httpmime-4.3.jar')
    compile files('libs/picasso-2.3.4.jar')
    compile files('libs/retrofit-1.8.0.jar')
}
最佳答案
加入

android {
    packagingOptions {
        exclude 'Meta-INF/DEPENDENCIES'
        exclude 'Meta-INF/LICENSE'
        exclude 'Meta-INF/LICENSE.txt'
        exclude 'Meta-INF/license.txt'
        exclude 'Meta-INF/NOTICE'
        exclude 'Meta-INF/NOTICE.txt'
        exclude 'Meta-INF/notice.txt'
        exclude 'Meta-INF/ASL2.0'
    }
}

应该解决你的问题.

猜你在找的Android相关文章