Uday Uday - 2 months ago 20
Android Question

No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_light_text_pressed')

I have built my app earlier using the Android studio 1.1. I had no problems then. After upgrading I am getting the following error when I try to rebuild my app.

D:\-----\src\main\res\color\common_signin_btn_text_dark.xml
Error:(4, 55) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_dark_text_pressed').
Error:(5, 85) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_dark_text_disabled').
Error:(6, 55) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_dark_text_focused').
Error:(7, 56) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_dark_text_disabled').
Error:(8, 26) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_dark_text_default').
D:\-------\src\main\res\color\common_signin_btn_text_light.xml
Error:(4, 55) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_light_text_pressed').
Error:(5, 85) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_light_text_disabled').
Error:(6, 55) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_light_text_focused').
Error:(7, 56) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_light_text_disabled').
Error:(8, 26) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_light_text_default').
Error:Execution failed for task ':colorBookPro:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Admin\AppData\Local\Android\sdk1\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1


I tried to search for solutions but couldn't find any solution. This is my build.gradle file

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion '22.0.1'

defaultConfig {
applicationId "com.demo"
minSdkVersion 10
targetSdkVersion 18
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
}

dependencies {
compile project(':main')
compile project(':library')
compile 'com.google.android.gms:play-services:8.3.0'
compile files('libs/StartAppInApp-2.4.7.jar')
}


The files are in the res/color folder like this.
click here for image
I also tried using API 23 and build tools 23.0.1 and many other options. I don't seem to understand the problem as it didn't exist the first time.
I built the app 2 months back. I am new to coding so please bear with me if I have written anything silly. I hope someone can help me.

Thanks in advance.

Answer

Thanks all for your suggestions but unfortunately none of them worked. I finally solved the error by replacing the color sources in common_signin_button_text_light.xml with

<item android:state_pressed="true" android:color="@color/common_google_signin_btn_text_light_pressed" />
    <item android:state_focused="true" android:state_enabled="false" android:color="@color/common_google_signin_btn_text_light_disabled" />
    <item android:state_focused="true" android:color="@color/common_google_signin_btn_text_light_focused" />
    <item android:state_enabled="false" android:color="@color/common_google_signin_btn_text_light_disabled" />
    <item android:color="@color/common_google_signin_btn_text_light_default" />

and common_signin_button_text_dark.xml with

<item android:state_pressed="true" android:color="@color/common_google_signin_btn_text_dark_pressed" />
    <item android:state_focused="true" android:state_enabled="false" android:color="@color/common_google_signin_btn_text_dark_disabled" />
    <item android:state_focused="true" android:color="@color/common_google_signin_btn_text_dark_focused" />
    <item android:state_enabled="false" android:color="@color/common_google_signin_btn_text_dark_disabled" />
    <item android:color="@color/common_google_signin_btn_text_dark_default" />

It seems the resources files update after updating Android Studio.

I was able to successfully build my app after making above changes.

Comments