Android Studio Error getting parent for element: No resource found that matches the specified name "Theme.AppCompat.Light.DarkActionBar"

I am starting android studio, I started building Hello World app but always on gradle build tab, it shows 2 errors. Errors I am running into:

Error: (1) Failed to get parent for element: No resource was found that matches the specified name "Theme.AppCompat.Light.DarkActionBar".

Error: Execution completed 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 '' terminated with non-zero exit value 1

This is my 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 ........

+3


source to share


1 answer


the theme "Theme.AppCompat.Light.DarkActionBar" is declared in the module "com.android.support:appcompat-v7"

so you need something like this in your 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 doesn't need an extra module.

"Theme.AppCompat.xxx" and "com.android.support:appcompat-v7" were created to allow older versions of Android, such as android-2.2, to provide users with newer features introduced in newer versions of Android.

+3


source







All Articles