17

I get an error when I build a project.

Error:

Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
C:\Users\MR Maleki\Desktop\WhoIsBetter2\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

Gradle:

  compileSdkVersion GLOBAL_COMPILE_SDK as int
    buildToolsVersion GLOBAL_BUILD_TOOLS

     compile fileTree(include: ['*.jar'], dir: 'libs')
        //----------------- Android Support Library --------------------------------
        compile "com.android.support:appcompat-v7:$GLOBAL_SUPPORT_LIBRARY_VERSION"
        compile "com.android.support:design:$GLOBAL_SUPPORT_LIBRARY_VERSION"
        compile "com.android.support:gridlayout-v7:$GLOBAL_SUPPORT_LIBRARY_VERSION"
        compile "com.android.support:cardview-v7:$GLOBAL_SUPPORT_LIBRARY_VERSION"

How should I fix this error? What would you recommend to fix the problem?

Brian
  • 14,610
  • 7
  • 35
  • 43
Mr Maleki
  • 171
  • 1
  • 1
  • 6

4 Answers4

17

This typically occurs when your support library's major version does not match your compile SDK version.

For example, if you are compiling with SDK version 24, you must use version 24.x.x of the support library (and vice-versa).

See also: Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23

Community
  • 1
  • 1
Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
  • 3
    This doesn't work. the SDK compiled against is v23, but the produced file as indicated by the original poster produces a values-v24. This occurs when compiling with support library 23, and again, explicitly using SDK v23, and all project dependancies are 23 compatible. Yet magically, the values-v24 with "Error retrieving parent for item:....." error is new. – Tom Pace Jul 29 '17 at 17:21
2

I got the same problem. When i compiled my old project. This error occur due to sdk version. My project compileSdkVersion 25 and Android studio version is 26.

So you have to change in your gradle:

1) At project level:

classpath 'com.android.tools.build:gradle:2.3.0' 

to

classpath 'com.android.tools.build:gradle:3.0.1'(latest android studio version)

2) At Module level:

compileSdkVersion 25
buildToolsVersion "25.0.2"
dependencies {
compile 'com.android.support:appcompat-v7:25.2.0'
.......
}

to

compileSdkVersion 26
buildToolsVersion "26.0.2"
dependencies {
compile 'com.android.support:appcompat-v7:26.+'
....
}

Hope it will help you!

Jatinder Kumar
  • 455
  • 5
  • 13
1

I´ve resolved changing my build.gradle inside android/build.gradle :

old: android: { compileSdkVersion 23 buildToolsVersion "23.0.1" ... }

dependencies: { compile "com.android.support:appcompat-v7:23.0.1" ... }

to android: { compileSdkVersion 24 buildToolsVersion "24.0.1" ... }

dependencies: { compile "com.android.support:appcompat-v7:24.0.1" ... }

0

Just try to update support library to latest one. it resolved my issue.

Also Note that: Be careful when update dependencies, different version library may caused error