1

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>

Robin
  • 1,567
  • 3
  • 25
  • 67

2 Answers2

1

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

Community
  • 1
  • 1
Apurva
  • 7,871
  • 7
  • 40
  • 59
  • Where can I find the "build.gradle" because I don't have one. – Robin Mar 30 '15 at 15:52
  • I'm using andoid studio, I can't find that 'tree'.. :$ – Robin Mar 30 '15 at 16:01
  • Open your android studio first and there will be a list of files on the left side from that list you will see build.gradle under Gradle Scripts. – Apurva Mar 30 '15 at 16:02
  • Do you see the files list on the left side?? (I am seeing) find build.gradle and open it and make changes I have suggested in answer and also install support library if you don't already have installed – Apurva Mar 30 '15 at 16:11
  • I don't see the build.gradle, Is it possible i don't have it? – Robin Mar 30 '15 at 16:13
  • If it is impossible, how is it possible that I can't find it? – Robin Mar 30 '15 at 16:34
  • Man if you have learned android from beginning, you can easily find it out. [See the highlighted part in this screenshot](http://i.imgur.com/uTdzyCv.png) it is called tree of files where all files of your project are listed. And there must will be `gradle.build(Module: app)` find it, open it, and under `dependencies{...}` copy `compile "com.android.support:appcompat-v7:18.0.+"` – Apurva Mar 30 '15 at 19:19
0

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.

Alex-v-s
  • 187
  • 1
  • 14