0

I just downloaded Android Studio and have created a new project.

Right off the bat, I'm getting two errors:

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

Here is my gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.example.test.testapp"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
}

and my installed packages:

enter image description here enter image description here

What is messed up here? Thanks

user1282637
  • 1,827
  • 5
  • 27
  • 56

2 Answers2

2

In your gradle, compileSdkVersion is 22 while your support library version is 23. The two should match.

See Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23

Community
  • 1
  • 1
headuck
  • 2,763
  • 16
  • 19
0

I also had same problem now. I tried below steps and worked perfectly.

In .gradle change like this

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:support-v13:23.0.1'
}

You'll get error in style file change it as below

<style name="AppTheme">
    <!-- Customize your theme here. -->
</style>

modify your main_menu.xml

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
    <item android:id="@+id/action_settings" android:title="@string/action_settings"
        android:orderInCategory="100" android:showAsAction="never" />
</menu>

In MainActivity remove AppCompatActivity like

MainActivity extends Activity

Mohammad Tauqir
  • 1,817
  • 1
  • 18
  • 53
  • This would remove the `appcompat` library and thus backward compatibility with devices running < Android 5.0, if you use any of the new ui features in your code. – headuck Sep 13 '15 at 11:24