Eclipse开发时自动创建appcompat_v7项目总是报错

使用Eclipse Juno作为Android集成开发环境,然而在创建Android项目的时候,如果Minimum Required SDk(需要的最小SDK)是4.0以下的,那么在创建项目,始终会额外创建一个项目(实际上称为兼容库更恰当些)appcompat_v7,而且始终提示下列错误,真是令人头疼:

F:\MyAndroidPlace\appcompat_v7\res\values-v11\styles_base.xml:115: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.

F:\MyAndroidPlace\appcompat_v7\res\values-v17\styles_base.xml:110: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'.

F:\MyAndroidPlace\appcompat_v7\res\values-v21\styles_base.xml:107: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'.

F:\MyAndroidPlace\appcompat_v7\res\values-v21\styles_base.xml:121: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'.

F:\MyAndroidPlace\appcompat_v7\res\values-v21\styles_base.xml:126: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListPopupWindow'.

F:\MyAndroidPlace\appcompat_v7\res\values-v21\styles_base.xml:138: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.

F:\MyAndroidPlace\appcompat_v7\res\values-v21\styles_base.xml:143: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.

F:\MyAndroidPlace\appcompat_v7\res\values-v21\styles_base.xml:129: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.PopupMenu'.

F:\MyAndroidPlace\appcompat_v7\res\values-v21\styles_base.xml:132: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.PopupMenu'.

F:\MyAndroidPlace\appcompat_v7\res\values-v21\styles_base.xml:146: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.

F:\MyAndroidPlace\appcompat_v7\res\values-v21\styles_base.xml:150: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.


解决方法一:

之前曾试着只创建Android 4.0的项目,即(Minimum Required SDk和Target SDK都选则SDK),这样创建项目时,不会创建appcompat_v7项目,创建的Android项目也就不会报错了。然而之所以Minimum Required SDk选择Android2.3,Target SDK选择Android4.0就是为了兼容各种主流手机配置的。显然这种方法并不理想。


解决方法二:

      因为看到每次系统报错,错误都集中在res目录下的values-v11,values-17,values-21,很明显这些版本的SDK 并没有更新下载到本地。所以只需要更新下Android SDK Manager->Tools下面的所有Android SDK Build-tools就行了。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值