Android Studio无法找到Theme.AppCompat.Light.DarkActionBar [英] Android studio cannot find Theme.AppCompat.Light.DarkActionBar
问题描述
我已经将Android Studio
项目从Github
导入到Android Studio
,尽管我的build.gradle
具有dependencies
I have imported an Android Studio
project from Github
into Android Studio
, and although my build.gradle
has the dependencies
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
}
尝试运行时,我仍然收到错误消息:
I still get the error when trying to run:
错误:(4,-1)android-apt-compiler:错误:检索父级时出错 item:找不到与给定名称匹配的资源 "Theme.AppCompat.Light.DarkActionBar".
Error:(4, -1) android-apt-compiler: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
我对这个构建系统几乎没有经验.您能指出我该怎么做才能解决此错误吗?
I have very little experience with this build system. Could you please indicate what I could do to solve this error?
推荐答案
确保已安装支持库.
在Android Studio中,您可以从工具">"Android">"SDK管理器">"SDK工具"选项卡中进行检查.
In Android Studio, you can check from Tools> Android > SDK manager > SDK Tools tab.
如果有更新,则可以更新Android Studio,SDK工具,构建工具.
You may update your Android Studio, SDK tools, Build tools if updates are available.
如果仍然没有运气,请尝试从项目的values文件夹中编辑style.xml文件,并将主题:Theme.AppCompat.Light.DarkActionBar更改为其他内容,例如:Theme.AppCompat.Light
If still no luck, from project's values folder try to edit style.xml file and change theme: Theme.AppCompat.Light.DarkActionBar to something else like: Theme.AppCompat.Light
这篇关于Android Studio无法找到Theme.AppCompat.Light.DarkActionBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!