Android Project Build Fails with Error gets the parent element for the element: the resource was not found that matches the specified name

I recently installed a new version of Android Studio version 1.5.1. And I imported a project that was built on a previous version of Android Studio, and tried to load the IDE into the environment. But it started to give me this error.

Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\yomal.ds\AppData\Local\Android\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 C:\Users\yomal.ds\AndroidStudio_Workspace\ClaimAssistant\app\build\intermediates\res\merged\debug\values-v23\values-v23.xml Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. Error:(18) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'. 

I checked my gradle.build, which looked great as far as I could see. Here is my gradle.build file.

 apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.informaticsint.claimassistant" minSdkVersion 14 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']) compile files('libs/gcm.jar') compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.google.android.gms:play-services:8.4.0' compile 'com.google.android.gms:play-services-ads:8.4.0' compile 'com.google.android.gms:play-services-identity:8.4.0' compile 'com.google.android.gms:play-services-gcm:8.4.0' } 

I tried to create a new project and add previous project sources to a new one. But this error appears when I set the SDK version to 22.

This is the same thing that happened to me, but the answers did not work. Error getting parent element for element: resource not found that matches the specified name after upgrading to AppCompat v23

I tried to downgrade the support library for each of my releases from 22 to 22.2.1

But when I install the project for compilation in SDK 23, it works fine, but leads to some other problems. This is what happens when I do this. resource error in android studio after update: resource not found

+5
source share
1 answer

The problem, as we found out in the comments, was a mismatch in the dependency.

As the question shows, it compiles against version 22 api. Support libraries must match the sdk version for compilation, which is also the case.

But Play Services 8.4.0 actually depends on 23+ support libraries, and it does not find resources due to 22 compilation of SDK and 22+ versions in the support library.

To fix this, there are two solutions:

  • Reduce Playback Services to 7.4.0
  • Update SDK compilation and support libraries to version 23

The easiest way to debug version mismatches is to run

  .gradlew dependencies 

In your application module (no project root), so the terminal command will look like

  cd app-folder/ ../gradlew dependencies 

And then check the dependency tree to see if something stands out.

+9
source

Source: https://habr.com/ru/post/1241513/


All Articles