欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the

程序员文章站 2022-06-19 17:43:25
Eclipse报values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name ‘Theme.AppCompat.Light.DarkActionBar’如下:*:\eswp\HelloAndroid\res\menu\main.xml:6: error: No resource identifier found for attribute 's...

Eclipse报values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name ‘Theme.AppCompat.Light.DarkActionBar’

如下:

*:\eswp\HelloAndroid\res\menu\main.xml:6: error: No resource identifier found for attribute 'showAsAction' in package 'com.example.helloandroid'
*:\eswp\HelloAndroid\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
*:\eswp\HelloAndroid\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
*:\eswp\HelloAndroid\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
*:\eswp\HelloAndroid\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
*:\eswp\HelloAndroid\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
*:\eswp\HelloAndroid\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
*:\eswp\HelloAndroid\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
*:\eswp\HelloAndroid\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
*:\eswp\HelloAndroid\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.

那是因为缺少appcompat_v7,方法,下载appcompat_v7(下载地址:appcompat_v7)工程并导入到工程空间,clear一下项目。如果你的项目目标版本过低,接着就会报:

*:\eswp\android-support-v7-appcompat\res\values-v21\themes_base.xml:87: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
*:\eswp\android-support-v7-appcompat\res\values-v21\themes_base.xml:88: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
*:\eswp\android-support-v7-appcompat\res\values-v21\themes_base.xml:134: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
*:\eswp\android-support-v7-appcompat\res\values-v21\themes_base.xml:138: error: Error: No resource found that matches the given name: attr 'android:colorButtonNormal'.
*:\eswp\android-support-v7-appcompat\res\values-v21\themes_base.xml:136: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
*:\eswp\android-support-v7-appcompat\res\values-v21\themes_base.xml:137: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
*:\eswp\android-support-v7-appcompat\res\values-v21\themes_base.xml:135: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
*:\eswp\android-support-v7-appcompat\res\values-v21\themes_base.xml:132: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
*:\eswp\android-support-v7-appcompat\res\values-v21\themes_base.xml:133: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
*:\eswp\android-support-v7-appcompat\res\values-v21\themes_base.xml:142: error: Error: No resource found that matches the given name: attr 'android:window*levation'.
*:\eswp\android-support-v7-appcompat\res\values-v21\themes_base.xml:146: error: Error: No resource found that matches the given name: attr 'android:window*levation'.

方法,把项目目标版本改成21或更高,比如23,最终解决问题。

由于公司最近非常忙,写得比较简单,以后有时间再补充详细解决方案,不过思路是对的,注意点就是你的项目工程版本,不要只看appcompat-v7项目版本。

本文地址:https://blog.csdn.net/qq_24835795/article/details/111885296