Eclipse开发时自动创建appcompat_v7项目总是报错
2016-10-20 22:40
525 查看
使用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就行了。
相关文章推荐
- 关于eclipse 在创建一个新项目时自动出现的appcompat v7如何解决
- Eclipse:创建项目自动产生appcompat_v7
- 关于Eclipse创建Android项目时,会多出一个appcompat_v7
- Eclipse 新建Android工程自动创建appcompat_v7
- 关于Eclipse创建Android项目时,会多出一个appcompat_v7的问题
- eclipse 创建项目时出现appcompat_v7?
- 关于Eclipse创建Android项目时,会多出一个appcompat_v7的问题
- 关于eclipse创建Android项目,会多创建一个appcompat_v7项目的问题
- 关于eclipse总是自动生成appcompat_v7的问题
- 关于Eclipse创建Android项目时,会多出一个appcompat_v7的问题
- EasyDemo*adt创建新的项目同时自动创建出appcompat_v7项目?
- 关于ECLIPSE下进行安卓开发工程项目名出现感叹号,并且appcompat_v7出现叉叉的解决
- 【入门】创建新项目-系统自动创建了appcompat_v7 res资源属性报错
- 关于Eclipse创建Android项目时,会多出一个appcompat_v7的问题
- android创建项目自动生成appcompat_v7问题
- 关于Eclipse创建Android项目时,会多出一个appcompat_v7的问题【转】
- 关于Eclipse创建Android项目时,会多出一个appcompat_v7的问题
- 【转】关于Eclipse创建Android项目时,会多出一个appcompat_v7的问题
- 新建android项目时Eclipse自动生成appcompat_v7
- 关于Eclipse创建Android项目时,会多出一个appcompat_v7的问题