Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

resource error in android studio after update: No Resource Found

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?

like image 809
James Dobson Avatar asked Aug 19 '15 10:08

James Dobson


People also ask

What is resource file in Android Studio?

Resources are the additional files and static content that your code uses, such as bitmaps, layout definitions, user interface strings, animation instructions, and more.

What is resource manager in Android Studio?

Resource Manager is a tool window for importing, creating, managing, and using resources in your app. You can open the tool window by selecting View > Tool Windows > Resource Manager from the menu bar or by selecting Resource Manager on the left side bar.

What is resource reference syntax in Android?

Regardless of the type of resource, all Android resources are identified by their IDs in Java source code. The syntax for ID in the XML file is called resource-reference syntax.


2 Answers

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' } 
like image 158
Roberto B. Avatar answered Sep 22 '22 03:09

Roberto B.


Change the appcompat version in your build.gradle file back to 22.2.1 (or whatever you were using before).

like image 39
Tunga Avatar answered Sep 21 '22 03:09

Tunga