No resource found that matches the given name 'android:Widget.Material.ActionButton'.

Eclipse 下搭建Android 开发环境(环境搭建参考:点击打开链接)

搭建完成后,新一个Andoroid 项目,出现如下错误:

[2014-11-19 14:16:34 - appcompat_v7] WARNING: unable to write jarlist cache file D:\My java Projects\appcompat_v7\bin\jarlist.cache
[2014-11-19 14:16:34 - appcompat_v7] WARNING: unable to write jarlist cache file D:\My java Projects\appcompat_v7\bin\jarlist.cache
[2014-11-19 14:16:36 - HelloAndroid] D:\My java Projects\appcompat_v7\res\values-v21\styles_base.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
[2014-11-19 14:16:36 - HelloAndroid] 
[2014-11-19 14:16:36 - HelloAndroid] D:\My java Projects\appcompat_v7\res\values-v21\styles_base.xml:79: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'.
[2014-11-19 14:16:36 - HelloAndroid] 
[2014-11-19 14:16:36 - HelloAndroid] D:\My java Projects\appcompat_v7\res\values-v21\styles_base.xml:83: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'.
[2014-11-19 14:16:36 - HelloAndroid] 
[2014-11-19 14:16:36 - HelloAndroid] D:\My java Projects\appcompat_v7\res\values-v21\styles_base.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'.
[2014-11-19 14:16:36 - HelloAndroid] 
[2014-11-19 14:16:36 - HelloAndroid] D:\My java Projects\appcompat_v7\res\values-v21\styles_base.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'.



原因:新建项目时,minSdkVersion相应的Android x.x(API)本地sdk中不存在。

解决方法 一:启动Android SDK Manager(如下图所示) ,更新sdk,将所需Android x.x(API xx)安装到本地即可。

No resource found that matches the given name 'android:Widget.Material.ActionButton'._第1张图片

(PS:建议把最常用的Android版本都下载到本地)


解决方法二:修改AndroidMenifest.xml文件,将minSDKVersion更改为本sdk中已有的android x.x(API xx).

这样会降低Android程序兼容的版本。

所以建议使用第一种方法,即更新sdk.




你可能感兴趣的:(Android开发)