v7-appcompat\res\values-v21\themes_base.xml:139: error: Error: No resource found that matches

 

v7-appcompat\res\values-v21\themes_base.xml:139: error: Error: No resource found that matches the given name

android-support-v7-appcompat\res\values-v21\themes_base.xml:139: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
android-support-v7-appcompat\res\values-v21\themes_base.xml:137: error: Error: No resource found that matches the given name: attr 'android:colorControlnormal'.
android-support-v7-appcompat\res\values-v21\themes_base.xml:134: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
android-support-v7-appcompat\res\values-v21\themes_base.xml:135: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
android-support-v7-appcompat\res\values-v21\themes_base.xml:144: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
android-support-v7-appcompat\res\values-v21\themes_base.xml:148: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.


今天升级了ADT(升级后为23.0.6)和SDK(Android 6.0),appcompat-v7和新建的工程都出现了问题,而且R文件不存在,这些让我纠结了一天,完成build-tools platform-tools等等各种更新,将原appcompat_v7删除,引入SDK中的v7,还是有错误

造成错误原因:

ADT和SDK升级为高版本后,appcompat-v7解压到了extras/android/support/v7/appcompat/libs文件夹下,其中的values-v21或者values-v23在低版本中无法匹配。


直到找到下面的参考文章,然后尝试了一下,果然药到病除。

具体解决办法:

1、打开appcompat_v7的project.properties文件

2、将target sdk修改为当前更新的sdk版本

方法1:如我这里将“target=android-19"改为”target=android-23“

方法2:选中当前工程,右击Properties,选择Android,将Project Build Target中的Target选为Android6.0



3、刷新或clean或重启Eclipse,错误消除。

参考:http://blog.csdn.net/jjwwmlp456/article/details/40514817

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念