Robin
Robin

Reputation: 1587

Android Error retrieving parent

I got this error... I don't know how to fix it... Could somebody please help me?

I got this on 3 files, but all 3 the same error...

error:

Error:(7, -1) Android Resource Packaging: [rpr-app] C:\Users***\Documents***\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.

One file:

<resources>

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

Upvotes: 1

Views: 66

Answers (2)

Apurva
Apurva

Reputation: 7901

You need to install support libraries from SDK Manager if you don't have installed.

And then if you are using Android Studio then,

From Android Studio, different than Eclipse:

1. Open the build.gradle file of your project.

2. Include the appcompat to it.

dependencies {
    ...
    compile "com.android.support:appcompat-v7:18.0.+"
}

Or if you are using Eclipse then,

Check this answer

Edit:

Open build.gradle(Module: app) from the files tree on the left side of the IDE.

enter image description here

Then add this to that file and sync it again

enter image description here

Upvotes: 1

Alex-v-s
Alex-v-s

Reputation: 187

I believe you might be targeting a very low API level.

In your AndroidManifest.xml file, change the android:minSdkVersion to like 15. You'll still target a majority of android devices and won't have to deal with compatibility issues.

Upvotes: 0

Related Questions