Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (2014) Getting Started with Android Running the Fun Facts Project

Joseph Anderson
Joseph Anderson
10,617 Points

Two resources errors and a debug error when I try to run FunFacts script

When I attempt to run FunFacts I get two "Error retrieving parent for item:" errors in my values-v23.xml file.

android:TextAppearance.Material.Widget.Button.Inverse

and

android:Widget.Material.Button.Colored

Cannot be found. Any idea on what I should do to get this up and running? Thanks.

4 Answers

Jon Kussmann
PLUS
Jon Kussmann
Courses Plus Student 7,254 Points

Hi Joseph,

In your build.gradle file you should update the values to the following:

compileSdkVersion 23 buildToolsVersion '23.0.0'

I hope this helps.

Joseph Anderson
Joseph Anderson
10,617 Points

Thanks for the quick reply, Jon. My buildToolsVersion was already '23.0.0' and when I changed compileSdkVersion 23 and was prompted to Sync, which I did, I got the following error:

Gradle sync failed: Cause: failed to find target with hash string 'android-23'

Joseph Anderson
Joseph Anderson
10,617 Points

apply plugin: 'com.android.application'

android { compileSdkVersion 23 buildToolsVersion "23.0.0"

defaultConfig {
    applicationId "com.bacchictendencies.funfacts"
    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 'com.android.support:appcompat-v7:23.0.0' }

For whatever reason the triple ` doesnt work to format this so sorry for the blob of code.

Jon Kussmann
Jon Kussmann
Courses Plus Student 7,254 Points

The two values that I posted are on separate lines of your gradle file, correct? I know I accidentally posted them on the same line in the original answer.

Yeah, I'm not sure if the system here can read gradle files, so I understand the formatting not working out.

Joseph Anderson
Joseph Anderson
10,617 Points

Ha, yes. correct, they are on different lines. Just goofy forum formatting.

Brook Thompson
Brook Thompson
103 Points

Hello, I am confused how to change this on mine. I am having the same problems. "Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'." "Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'."

but also

"Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Brook\AppData\Local\Android\sdk\build-tools\23.0.0\aapt.exe'' finished with non-zero exit value 1"

And I cannot seem to find the emulator.

Jon Kussmann
PLUS
Jon Kussmann
Courses Plus Student 7,254 Points

Hmm, interesting. So there was an update today that gave me the same error and that change fixed it for me.

Could you go to the SDK Manager and make sure everything is updated? I prefer to use the standalone SDK manager since the other one doesn't seem to work for me.

Daniel Hahm
Daniel Hahm
230 Points

I have 2 error messages too Error:(4) No resource identifier found for attribute 'showAsAction' in package 'com.example.dhys242.funfacts' Error:(4) Execution failed for task ':app:processDebugResources'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\dhys242\Downloads\android-studio-bundle-windows\android-studio\sdk\build-tools\android-4.4W\aapt.exe package -f --no-crunch -I C:\Users\dhys242\Downloads\android-studio-bundle-windows\android-studio\sdk\platforms\android-19\android.jar -M C:\Users\dhys242\AndroidStudioProjects\FunFacts\app\build\intermediates\manifests\debug\AndroidManifest.xml -S C:\Users\dhys242\AndroidStudioProjects\FunFacts\app\build\intermediates\res\debug -A C:\Users\dhys242\AndroidStudioProjects\FunFacts\app\build\intermediates\assets\debug -m -J C:\Users\dhys242\AndroidStudioProjects\FunFacts\app\build\generated\source\r\debug -F C:\Users\dhys242\AndroidStudioProjects\FunFacts\app\build\intermediates\libs\app-debug.ap_ --debug-mode --custom-package com.example.dhys242.funfacts -0 apk Error Code: 1 Output: C:\Users\dhys242\AndroidStudioProjects\FunFacts\app\build\intermediates\res\debug\menu\menu_fun_fact.xml:4: error: No resource identifier found for attribute 'showAsAction' in package 'com.example.dhys242.funfacts'

i get 2 errors: Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\user\AppData\Local\Android\sdk\build-tools\23.0.1\aapt.exe'' finished with non-zero exit value 1

Error:(1) Resource id cannot be an empty string (at 'id' with value '@+id/').