码迷,mamicode.com
首页 > 移动开发 > 详细

AndroidStudio build.gradle 报错

时间:2015-01-26 22:41:42      阅读:310      评论:0      收藏:0      [点我收藏+]

标签:

Android Studio. I‘m getting this kind of error during application run.

Error:Execution failed for task ‘:app:packageDebug‘. Duplicate files copied in APK META-INF/notice.txt

build.gradle

apply plugin: ‘android‘

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.1"

    packagingOptions {
        exclude ‘META-INF/DEPENDENCIES‘
        exclude ‘META-INF/NOTICE‘
        exclude ‘META-INF/LICENSE‘
        exclude ‘META-INF/LICENSE.txt‘
        exclude ‘META-INF/NOTICE.txt‘
        exclude ‘META-INF/ASL2.0‘
    }

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile(‘proguard-android.txt‘), ‘proguard-rules.txt‘
        }
    }
}

dependencies {
    compile ‘com.android.support:appcompat-v7:19.0.1‘
    compile ‘com.j256.ormlite:ormlite-android:4.48‘
    compile ‘org.codehaus.jackson:jackson-core-asl:1.9.13‘
    compile ‘org.codehaus.jackson:jackson-mapper-asl:1.9.13‘
    compile ‘com.octo.android.robospice:robospice:1.4.11‘
    compile ‘com.octo.android.robospice:robospice-spring-android:1.4.11‘
}

 

How can I fix this error?

EDITED

These exclude options solved my problem:

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‘
    }

 

AndroidStudio build.gradle 报错

标签:

原文地址:http://www.cnblogs.com/niray/p/4251367.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!