android中出现Error retrieving parent for item: No resource found that matches the Theme.AppCompat.Light

2023-03-14,,

styles.xml中<style name="AppBaseTheme" parent="Theme.AppCompat.Light">提示如下错误,这是版本问题。

error: Error retrieving parent for item: No resource found that matches the given name

'Theme.AppCompat.Light'.

解决方法:

在Eclipse中打开任意一个.java文件,输入  android.R.style.   这时你会看到一个提示列表,仔细看看,再对比一下,看哪个与原有的最接近就选择哪个。用将下划线替换成"."就可了。

<style name="AppBaseTheme" parent="Theme.AppCompat.Light">

改为

<style name="AppBaseTheme" parent="android:Theme.Light">

同理,将

<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
改为

<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
 
引用自:http://blog.163.com/wslngcjsdxdr@126/blog/static/16219623020146971323118/

android中出现Error retrieving parent for item: No resource found that matches the Theme.AppCompat.Light的相关教程结束。

《android中出现Error retrieving parent for item: No resource found that matches the Theme.AppCompat.Light.doc》

下载本文的Word格式文档,以方便收藏与打印。