[英]Android studio Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'
I am a beginner in android studio, i have started creating the app named Hello World but always in the gradle build tab, its shows 2 errors. 我是android studio的初学者,我已经开始创建名为Hello World的应用程序但总是在gradle构建选项卡中,它显示2个错误。 The errors i face are: 我面临的错误是:
Error:(1) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. 错误:(1)检索项目的父项时出错:找不到与给定名称“Theme.AppCompat.Light.DarkActionBar”匹配的资源。
Error:Execution failed for task ':app:processDebugResources'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'e:\\Program Files\\Android\\sdk\\build-tools\\22.0.1\\aapt.exe'' finished with non-zero exit value 1 错误:任务':app:processDebugResources'的执行失败。> com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:处理'命令'e:\\ Program Files \\ Android \\ sdk \\ build-tools \\ 22.0.1 \\ aapt.exe''以非零退出值1结束
This is my build.gradle 这是我的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.example.android.helloworld"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
} dependencies {}
What should i do now to run my program without errors, please help me........ 我现在应该怎么做才能正常运行我的程序,请帮帮我........
theme "Theme.AppCompat.Light.DarkActionBar" is declared in modul "com.android.support:appcompat-v7" 主题“Theme.AppCompat.Light.DarkActionBar”在modul“com.android.support:appcompat-v7”中声明
so you need something like this in your build.gradle. 所以你需要在build.gradle中使用这样的东西。
dependencies {
compile 'com.android.support:appcompat-v7:22.1.1'
}
alternativly you can use "Theme.Holo.Light.DarkActionBar" instead which is part of newer android versions and does not need an extra modul. 另外,您可以使用“Theme.Holo.Light.DarkActionBar”代替,它是较新的Android版本的一部分,不需要额外的模块。
"Theme.AppCompat.xxx" and "com.android.support:appcompat-v7" was created to allow old android versions like android-2.2 to user newer features introduced in newer android versions. 创建“Theme.AppCompat.xxx”和“com.android.support:appcompat-v7”以允许像Android-2.2这样的旧版本用户在较新的Android版本中引入更新的功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.