更新后 android 工作室中的资源错误: 没有找到资源

在最近对 Android Studio 进行了更新之后,我们遇到了一些问题,需要编译一个以前可以工作的项目。起初我们得到了以下错误:

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

我将 gradle 文件中的 sdk build 目标更新为23,这使得这个特定的问题消失了,但是它给我们留下了大量的 apache.http 包错误(特别是,我们用于 http 的大量 apache 包现在在 sdk 23中消失了)。

我想做的是解决奇怪的资源错误,但没有更新到 sdk23。我现在没有时间重写我们的工具库来使用任何已经发布的 apache http 组件的新实现。有人知道吗?

123921 次浏览

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

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.

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

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

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

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

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.

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.

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.

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

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.

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

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).