简体   繁体   中英

Build failed after updating SDK tools and plays services libraries

Hi I've currently updated my SDK tools as well as the other components of my SDK except for the M-preview and the sample files which is currently I won't be using. Now problem is after updating the libraries and syncing the gradle it gives me this error:

error: Attribute "track" has already been defined
error: Attribute "thumbTextPadding" has already been defined
error: Attribute "switchMinWidth" has already been defined
error: Attribute "switchPadding" has already been defined

and now my app won't build or run due to this values error on which I'm not sure of why it happens. Here's my current gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    lintOptions{
        checkReleaseBuilds false
        abortOnError true
    }

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 17
        versionName "1.1.0"
    }
    buildTypes {
        release {
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }
}



dependencies {
    compile 'com.android.support:design:22.2.0'
    compile 'com.joooonho:selectableroundedimageview:1.0.1'
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.google.android.gms:play-services:7.5.0'
    compile 'in.srain.cube:grid-view-with-header-footer:1.0.9'
    compile 'com.felipecsl.quickreturn:library:1.5.1'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.2'
    compile 'it.sephiroth.android.library.imagezoom:imagezoom:+'
    compile 'com.makeramen:roundedimageview:1.5.0'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':libraries:facebook')
}

Can someone point out to me on why does this happen? TIA.

By the look of it the attributes you are using ie

 error: Attribute "track" has already been defined
    error: Attribute "thumbTextPadding" has already been defined
    error: Attribute "switchMinWidth" has already been defined
    error: Attribute "switchPadding" has already been defined 

might being used by the M-Preview SDK.Just change your attributes of the Switch you are using in the attrs.xml file and you are good to go!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM