Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in generated values-23 file in Android

I am getting this error when I try to build my project.

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 'C:\Users\Home\AppData\Local\Android\sdk\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 1

And when I click on it it takes me to the v-23 values file of generated folder which contains following code.

    <?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="CardView" parent="Base.CardView">
        <item name="cardBackgroundColor">?android:attr/colorBackgroundFloating</item>
    </style>
</resources>

This is my app gradle file

  apply plugin: 'com.android.application'
android {
    compileSdkVersion 22
    buildToolsVersion '23.0.2'

    defaultConfig {
        applicationId "com.xxxx"
        minSdkVersion 19
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:support-v4:22.2.1'
    compile 'com.android.support:design:22.2.1'
    compile 'com.commit451:inkpageindicator:1.0.2'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'ch.acra:acra:4.5.0'
    compile 'com.pkmmte.view:circularimageview:1.1'
    compile 'com.google.android.gms:play-services-maps:7.8.0'
    compile 'com.google.android.gms:play-services-location:7.8.0'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.google.android.gms:play-services:7.8.0'
    compile 'com.google.code.gson:gson:2.6.2'

}

And when I change everything in gradle to version 23 this error goes away but as I am using http libraries and they are removed from 23 version therefore I am forced to use 22 version. My project was working perfectly fine before and at a sudden it started giving this error. Only thing I done was install a support repository which I was using in other project and it start giving error in this project too. Any way to resolve this error?

like image 548
Vivek Mishra Avatar asked Mar 12 '16 17:03

Vivek Mishra


1 Answers

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

In my case I use v-22 so i changed Facebook sdk version to 4.8 compile 'com.facebook.android:facebook-android-sdk:4.8.0'

like image 137
Yonggeon Avatar answered Sep 23 '22 12:09

Yonggeon