resource error in android studio after update: No Resource Found
Solution 1
Change the appcompat version in your build.gradle file back to 22.2.1 (or whatever you were using before).
Solution 2
You need to set compileSdkVersion to 23.
Since API 23 Android removed the deprecated Apache Http packages, so if you use them for server requests, you'll need to add useLibrary 'org.apache.http.legacy'
to build.gradle as stated in this link:
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
...
//only if you use Apache packages
useLibrary 'org.apache.http.legacy'
}
Solution 3
in your projects build.gradle file... write as below.. i have solved that error by change the appcompat version from v7.23.0.0 to v7.22.2.1..
dependencies
{
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}
Solution 4
Attention, wrong answer coming! But anyone without apache libraries or so might find
compileSdkVersion 23
buildToolsVersion "23.0.0"
//...
dependencies {
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
}
helpful, it did the trick for me.
Solution 5
you should change your compiledsdkversion and targetversion to 23 in the build gradle file specific to the app.Make sure you installed sdk 23, version 6.0 before this.You can watch this vid for more help.https://www.youtube.com/watch?v=pw4jKsOU7go
Related videos on Youtube
James Dobson
Updated on July 06, 2020Comments
-
James Dobson almost 4 years
After a recent update to Android Studio, we're having problems getting a project to compile that previously worked. At first we were getting the following error:
/Users/james/Development/AndroidProjects/myapp/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/res/values-v23/values-v23.xml 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'.
I updated the sdk build target in our gradle file to 23, which made this specific issue go away, but it left us with a ton of apache.http package errors (specifically, a ton of apache packages we use for http stuff are now gone in sdk 23).
What I want to do is solve the strange resource error, but without updating to sdk 23. I don't have the time to re-write our tools library right now to use whatever new implementation of apache http components has been issued. Does anyone have any ideas?
-
Solace over 8 yearsDon't you get the error in the appcompat_v7 res/values-v23/styles.xml itself (rather than in your project)?
-
James Dobson over 8 yearsNot sure I understand your question? We were getting the issue in a generated file as indicated by the file path in the error posted above.
-
BK Batchelor over 8 yearsIf the error is occurring in the generated files, then you have to update the the build tools, in gradle, to match the libraries version. i.e. buildToolsVersion "23.0.1"
-
-
James Dobson almost 9 yearsThanks, this was the solution. I followed the instructions here: code.google.com/p/android/issues/detail?id=183122#makechanges specifically, the solution offered by scott. I had to delete the 23.0.0 in my sdk folder, delete the version 23 sdk in the SDK manager and then do a clean & rebuild
-
Someone Somewhere almost 9 yearsJames, thanks for the solution. However, I am just bloody astounded at this PITA situation - because I never had appcompat-v7:22.2.1 installed !!
-
JamesDeHart almost 9 yearsThis will work but you will want to make sure to install the new SDK Version. API 23 (Android 6.0 Platform). This will allow you to support newer devices. That is why when you change the "appcompat version" to a newer version it will require the newer SDK version.
-
Jörn Buitink almost 9 yearsThis answer is much better than to go back to 22.2.1
-
Solace over 8 yearsIs there a way to do that in Eclipse?
-
Fayçal over 8 years@Solace Eclipse is useless
-
Solace over 8 years@BackPacker Try but my computer is too slow to support AS. I tried it, and when I start it, everything starts hanging.
-
James Dobson over 8 yearsIt is certainly an ideal answer and is obviously the correct course of action for most people, however, it does not answer my question which was to solve the issue without updating the sdk version. Doing so breaks a library we depend on but didn't have time to update at the time. We've since updated the library to make use of the new features and we can now safely update to sdk 23.
-
James Dobson over 8 years@RobertoB. Thanks, thats good info. We've already updated our codebase to use the new apache libraries, but hopefully it will help others!
-
mdelolmo over 8 yearsHow is this related to the error messages the OP reports? I think compileSdkVersion is a valid workaround, but using the legacy apache library is just an indirect requirement.
-
nyxee over 8 yearsThis was useful. I got an error under gradle verion 1.1.1 since it doesnt support the
**usesLibrary**
declaration. Please include the relevantclasspath 'com.android.tools.build:gradle:1.1.1'
line for completeness. -
sud007 over 8 yearsNo NO No....I wasn't expecting this! BUT THIS WORKED!! What's the point in updating it to 23.0.1 then?
-
TheRealChx101 over 8 years@BackPacker No. Android Studio is the problem. I have a good computer and Android Studio takes forever to compile a simple hello world app.
-
Mark Smith over 8 yearsThis one gets my +1: it's not always appropriate to just update to the latest version of everything immediately someone tells you to. This one answers the original question, and fixes the problem for me.
-
NinjaCoder over 8 yearsWhy does it have so problem with apache libraries?
-
Tunga over 8 yearsFor those who keep downvoting this, please leave a comment explaining why. Note that the question says "What I want to do is solve the strange resource error, but without updating to sdk 23." This is the answer to that precise question. It intentionally does not deal with the larger issue of whether remaining on an old SDK is good or recommended because that is not what was asked.
-
Bron Davies over 8 yearsJust because someone asked the wrong question, doesn't make this the right answer. See answer from @roberto-b below
-
Ashok Singhal about 8 years@RobertoB., After making following configs: compileSdkVersion 23 buildToolsVersion "23.0.0" and supprtVersion in appcompat to 23.0.0 I am getting this issue Error:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (23.3.0) and test app (22.2.0) differ. See g.co/androidstudio/app-test-app-conflict for details. Can you please help in this