【发布时间】:2014-05-26 14:45:52
【问题描述】:
通过所有教程在项目中添加库后,我在 style.xml 中出现错误
Error: No resources found that matches the given name: attr 'switchStyle'
Error: No resources found that matches the given name: attr 'textAppearance'
在 Eclipse 中我可以选择“clean project”,这个问题会消失,直到下次更改 style.xml
<style name="AppTheme" parent="Theme.Sherlock.Light">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="switchStyle">@style/switch_light</item>
<item name="textAppearance">@style/TextAppearance</item>
<item name="android:actionBarStyle" tools:ignore="NewApi">@style/Widget.Styled.ActionBar</item>
</style>
我的步骤:
- 在 Eclipse 中创建的项目现在导入到 IntelliJ IDEA
- 项目和 ActionBar SDK 设置 - Google Android 4.4.2
- 清单项目设置:minSDK - 10;目标 SDK - 19
- 将模块添加到项目设置(不是 jar - 通过导入模块的所有 ActionBar 项目 -> 选择 ActionBar 文件夹 -> 从现有源创建模块或从外部模块 Eclipse 导入)
- 将模块依赖添加到 support-v4
- 将 ActionBar 模块添加到 Project 模块的依赖项中
- 在 Facets ActionBar 模块中是库
- 从导入的 ActionBar 模块测试文件夹中删除
- 重建项目 - 错误
- 制作项目 - 错误。
附言。项目很旧,在没有 Gradle 的 Eclipse 中创建。
【问题讨论】:
标签: android intellij-idea actionbarsherlock