错误:(2)属性“barLength”已经定义

时间:2016-02-18 07:12:27

标签: android

在android中获取Error:(2) Attribute "barLength" has already been defined错误。

这是错误代码:

abc:processDebugResources  
/home/abc/piyush/project/plutochat/20-10-15/abc_ANDROID   
STUDIO/abc/src/main/res/values/colors.xml

Error:(2) Attribute "barLength" has already been defined

/home/abc/piyush/project/abc/20-10-15/abc_ANDROID STUDIO/abc/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/res/values-v23/values-v23.xml

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

Error:Execution failed for task ':abc:processDebugResources'.
 com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/abcAndroid/Sdk/build-tools/21.1.2/aapt'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 4.675 secs

manifest.xml文件代码:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        multiDexEnabled true
        applicationId "com.abcd.beta"
        minSdkVersion 15
        targetSdkVersion 21

    }

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

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'

    }

}

dependencies {
    //compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':facebookSDK')
    compile project(':lib')
    compile 'com.android.support:support-v4:21.0.3'
    compile 'it.neokree:MaterialNavigationDrawer:1.3.2'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.paypal.sdk:paypal-android-sdk:2.13.1'
    compile files('libs/Shutterbug-1.0.0.jar')
    compile files('libs/httpclient-4.3.6.jar')
    compile files('libs/httpcore-4.3.3.jar')
    compile files('libs/httpmime-4.3.6.jar')
    compile files('libs/universal-image-loader-1.9.3.jar')
    compile files('libs/sinch-android-rtc-3.7.1.jar')
}

1 个答案:

答案 0 :(得分:0)

你的logcat说

  

错误:(2)检索项目的父项时出错:找不到资源   匹配给定名称'android:Widget.Material.Button.Colored'。

请在下面设置配置。

compileSdkVersion 23 
buildToolsVersion "23.0.1" 

并使用此

compile 'com.google.android.gms:play-services:8.3.0'