我的在sdk更新到5.0时,新建项目出现了以下的错误:
1:error: Error retrieving parent for item: No resource found that matches the given name
'Theme.AppCompat.Light'.
2:R文件也没有生成
一位网友提供这样的方法,可以解决错误
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">
,但是,我不明白是什么什么原因导致的。哪位网友明白的话,可以跟我说一下