问题描述
我已经解决这个问题几个小时了.从 github 下载存储库后,任何 .xml 文件中唯一的错误是:
I have been on this problem for a couple hours. After downloading a repository from github, the only error in any .xml file is:
No resource found that matches the given name '@style/Theme.AppCompat.Light'
代码非常简单,但我没有找到一个简单的答案,关于如何减轻错误.
The code is very straightforward, but there is not one straightforward answer I have found, on how to alleviate the error.
这是代码(在文件 res/values/styles.xml 中):
here is the code (in file res/values/styles.xml):
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
<!-- API 14 theme customizations can go here. -->
</style>
项目位于:https://github.com/erikswed/InstaChatX我在 Windows 上,使用 Eclipse Kepler
The project is located at: https://github.com/erikswed/InstaChatXI am on Windows, using Eclipse Kepler
推荐答案
这样做的步骤是什么?AppCompat 位于何处?
在此处下载支持库:
http://developer.android.com/tools/support-library/setup.html
如果您使用的是 Eclipse:
If you are using Eclipse:
转到顶部的选项卡并选择(Windows -> Android SDK Manager).在附加"部分下,选中Android 支持库"并检查是否安装.
Go to the tabs at the top and select ( Windows -> Android SDK Manager ). Under the 'extras' section, check 'Android Support Library' and check it for installation.
之后,可以在以下位置找到 AppCompat 库:
After that, the AppCompat library can be found at:
android-sdk/extras/android/support/v7/appcompat
您需要在您的 Android 项目中引用此 AppCompat 库.
You need to reference this AppCompat library in your Android project.
将库导入 Eclipse.
Import the library into Eclipse.
- 右键点击您的 Android 项目.
- 选择属性.
- 点击底部的添加..."以添加库.
- 选择支持库
- 清理并重建您的项目.
这篇关于找不到与给定名称“@style/Theme.AppCompat.Light"匹配的资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!