找不到与给定名称匹配的资源(在'cardBackgroundColor'处,值为'?android:attr/colorBackgroundFloating') [英] No resource found that matches the given name (at 'cardBackgroundColor' with value '?android:attr/colorBackgroundFloating')

查看:283
本文介绍了找不到与给定名称匹配的资源(在'cardBackgroundColor'处,值为'?android:attr/colorBackgroundFloating')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试编译时收到以下两个错误消息:

I am getting these two error messages when trying to compile:

/Users/dericw/coding/myApplication/lfdate/android/app/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.2.1/res/values-v23/values-v23.xml
Error:(3, 5) No resource found that matches the given name (at 'cardBackgroundColor' with value '?android:attr/colorBackgroundFloating').
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/dericw/Library/Android/sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1

Android Studio然后使用以下样式打开v23/values-23.xml:

Android Studio then opens up v23/values-23.xml with this style:

    <style name="CardView" parent="Base.CardView">
        <item name="cardBackgroundColor">?android:attr/colorBackgroundFloating</item>
    </style>

但是我的应用程序中没有任何定义.这是一个生成的文件,给我错误.我很困惑如何解决此问题?有人遇到过吗?我该如何解决?

But I don't have that defined anywhere in my app. It is a generated file that is giving me the error. I am pretty stumped on how to fix this issue? Has anyone every encountered this before? How do I fix this?

项目构建文件

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
        classpath 'com.google.gms:google-services:2.0.0-alpha6'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

应用构建文件

buildscript {
    repositories {
        mavenCentral()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 22
    buildToolsVersion '23.0.2'

    defaultConfig {
        applicationId "com.something.myapp"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 200
        versionName "1.7.1"
    }

    buildTypes {
        debug {
            versionNameSuffix '-debug'
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
            zipAlignEnabled true
        }
    }

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

    sourceSets {
        androidTest.setRoot('src/test')
    }
}

repositories {
    mavenCentral()
    maven {
        url 'https://oss.sonatype.org/content/repositories/snapshots/'
    }
    maven {
        url 'https://maven.fabric.io/public'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile('com.crashlytics.sdk.android:crashlytics:2.4.0@aar') {
        transitive = true;
    }
    compile('org.apache.httpcomponents:httpmime:4.3.6') {
        exclude module: 'httpclient'
    }
    compile project(':viewPagerIndicator')
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:cardview-v7:22.2.1'
    compile 'com.android.support:recyclerview-v7:22.2.1'
    compile 'com.android.support:design:22.2.1'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.mcxiaoke.volley:library:1.+'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.parse:parse-android:1.+'
    compile 'com.google.android.gms:play-services-gcm:8.3.0'
    compile 'com.google.android.gms:play-services-analytics:8.3.0'
    compile 'joda-time:joda-time:2.+'
    compile 'com.koushikdutta.async:androidasync:2.+'
    compile 'com.edmodo:rangebar:1.+'
    compile 'org.lucasr.twowayview:twowayview:0.+'
    compile 'com.github.amlcurran.showcaseview:library:5.4.+'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.+'
    compile 'com.getbase:floatingactionbutton:1.+'
    compile 'com.mixpanel.android:mixpanel-android:4.+'
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
    compile 'com.wefika:flowlayout:0.+'
    compile 'com.hudomju:swipe-to-dismiss-undo:1.+'
    compile 'com.soundcloud.android:android-crop:1.0.1@aar'
    compile 'com.squareup.picasso:picasso:2.+'
}

apply plugin: 'com.google.gms.google-services'

推荐答案

编译'com.facebook.android:facebook-android-sdk:4.+'需要V-23

compile 'com.facebook.android:facebook-android-sdk:4.+' needs V-23

将facebook版本SDK更改为4.8.0,然后它将不使用该资源文件.然后,您的代码将启动&正在运行/

Change the facebook version SDK to 4.8.0 then it won't use that resource file. Then your code will be up & running/

这篇关于找不到与给定名称匹配的资源(在'cardBackgroundColor'处,值为'?android:attr/colorBackgroundFloating')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆