【发布时间】:2014-02-14 00:46:37
【问题描述】:
我依靠兼容性库在旧版本的 Android 上使用操作栏。我已将其添加到我的build.gradle 文件中,如下所示:
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:support-v4:+'
}
还有一个styles.xml 文件的示例:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base theme -->
<style name="AppName" parent="@style/Theme.AppCompat.Light"></style>
</resources>
项目在 Android Studio 0.4.4 中通过命令行和 IDE 成功构建。但是,在编辑器中打开文件时出现以下错误:
我尝试过使缓存无效、清理项目、与 Gradle 同步并在删除 IntelliJ 文件后重新导入项目,但没有任何变化。我在build.gradle 文件中也遇到这样的错误:
但我不知道这是否与这个特定问题有关。如何让 Android Studio 找到兼容库资源?
【问题讨论】:
-
这是0.4.2的问题,0.4.4看到这样的事情我很惊讶,看看这个问题stackoverflow.com/questions/21316055/…
-
@pyus13 奇怪的是Android Studio可以找到类,只是找不到资源。
标签: android-studio