Theme.AppCompat.Light.NoActionBar
显示为红色且未被识别。这是我做了什么:使用SDK经理如何使用Intellij导入appcompat-v7
下载支持库
推门进去,项目结构中添加一个新的图书馆,选择的程序兼容性-v7-23.4.0-javadoc.jar和程序兼容性,v7- appcompat-7的23.4.0文件夹中的23.4.0-sources.jar文件。
选择OK后,将appcompat-v7-23.4.0-sources添加到我的库中。
然后我去了Modules - > Dependencies以确保appcompat-v7-23.4.0-sources被选中并点击OK。
它没有工作......?该行仍然无法识别,图书馆甚至没有出现在我的libs文件夹中。我尝试了另一种方式来复制.jar文件,将它们粘贴到我的libs文件夹中,然后右键单击以从此处添加到库,但同样的事情发生。我怎样才能使这个工作?我的分钟设置为7,目标21和清单中最多23个。 styles.xml中的错误是“无法解析符号”。
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="AppTheme.Base"></style>
<!-- Base theme applied no matter what API -->
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
我试图重建我的项目,只有这样,我得到了以下错误:
Information:5/26/16, 12:29 PM - Compilation completed with 4 errors and 0 warnings in 4s 99ms
/Users/accudeveloper/Android-App-2.0/android2.0/res/values/styles.xml
Error:(5, -1) android-apt-compiler: [android2.0] /Users/accudeveloper/Android-App-2.0/android2.0/res/values/styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.
Error:(8, -1) android-apt-compiler: [android2.0] /Users/accudeveloper/Android-App-2.0/android2.0/res/values/styles.xml:8: error: Error: No resource found that matches the given name: attr 'colorAccent'.
Error:(6, -1) android-apt-compiler: [android2.0] /Users/accudeveloper/Android-App-2.0/android2.0/res/values/styles.xml:6: error: Error: No resource found that matches the given name: attr 'colorPrimary'.
Error:(7, -1) android-apt-compiler: [android2.0] /Users/accudeveloper/Android-App-2.0/android2.0/res/values/styles.xml:7: error: Error: No resource found that matches the given name: attr 'colorPrimaryDark'.
这是我找到的.jar文件。这条道路看起来是否正确?基于此网站上的相关问题的答案
Android的SDK /演员/安卓/ m2repository/COM /安卓/支持/程序兼容性-V7
应该有一个程序兼容性/ RES /值目录以及但我没有看到。
为什么不使用FREE-ANDROID STUDIO,这是在GOOGLE支持下的类固醇上的intelliJ-Idea? –
我遵循的一些教程使用了IntelliJ,所以我就坚持使用它。但所有这些都让我头痛。我最终可能会试用Android Studio。 – terratunaz
再次,Android Studio使用相同的内核,相同的快捷方式,相同的界面。并且无需卸载IDEA,您可以安装少量Android Studios实例。 –