[java] 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?

This question is related to java android apache

The answer is


First of all,

Try to check your SDK folder, for me, it was mydocuments/appdata/sdk.... etc. So basically my sdk folder was not fully downloaded, the source of this problem mainly. You have to either use another fully downloaded android sdk(including Tools section and extras that you really need) or use the eclipse sdk that you may downloaded earlier for your Eclipse android developments. Then build->clean your project once again.

Worth to try.


Method 1: It is showing.you did not install Api 23. So please install API 23.

Method 2:

Change the appcompat version in your build.gradle file back to 22.0.1 (or less).


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


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.


Try to match all version:

compileSdkVersion 23
buildToolsVersion '23.0.0'
targetSdkVersion 23
compile 'com.android.support:appcompat-v7:23.0.0'

It's work for me.


It's works just when the build.grade was changed to that:

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "blablabla"
        minSdkVersion 15
        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:22.0.0'
}

compileSDK should match appCompat version. TargetSDK can still be 22 (e.g. in case you didn't update to the new permission model yet)


Upgrade to use API 23 (Android 6.0) or change back the appcompat-v7 to 22.2.2 version in Gradle. This work for me when add google play service


if you have :

/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'.

error , you must change your appcompat , buildtools , sdk to 23 but , if you don't like to change it and must be in 22 do this :

  • compile 23
  • target 22

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'

}

Below screen shot is for better understanding.


I noticed I didn't have sdk 23 installed. So I first installed it then re-built my project. And it worked fine. Also compilesdkVersion should be 23


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'
}

if u are getting errors even after downloading newest SDK and Android Studio I am a newbie: What i did was 1. Download the recent SDK (i was ) 2.Open file-Project structure (ctrl+alt+shift+S) 3. In modules select app 4.In properties tab..change compile sdk version to api 23 Android 6.0 marshmallow(latest)

make sure compile adk versionand buildtools are of same version(23)

Hope it helps someone so that he wont suffer like i did for these couple of days.


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to apache

Enable PHP Apache2 Switch php versions on commandline ubuntu 16.04 Laravel: PDOException: could not find driver How to deploy a React App on Apache web server Apache POI error loading XSSFWorkbook class How to enable directory listing in apache web server Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details How to enable php7 module in apache? java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing while starting Apache server on my computer