finux
finux

Reputation: 11

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

I have a problem with Gradle !!

It keeps showing me errors , can some one help me to resolve this problem

Note: It's my first time to install android studio

one

Upvotes: 1

Views: 321

Answers (5)

piotrek1543
piotrek1543

Reputation: 19351

The problem is you're using

compile 'com.android.support:appcompat-v7:19.+'

which gives you all possibilities of Android 4.4.2 Kitkat API 19 and older.

In your project you're trying to use Material Themes which belongs to newer version, I mean com.android.support:appcompat:$version, where version > 21.

Material Design was introduced with Android 5.1 Lollipop API 21

I higly reccomend you to change your build.gradle file to:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"

defaultConfig {
    minSdkVersion 21
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

but of course changing appcompat library to version :

com.android.support:appcompat-v7:23.0.1"

would be enough ;-)

Hope it would help

Upvotes: 0

USER9561
USER9561

Reputation: 1084

Try using this:

compile 'com.android.support:appcompat-v7:24.1.0'

Use latest support library and change your target and compile sdk also

compileSdkVersion 24

buildToolsVersion "24.0.1"

targetSdkVersion 24

Upvotes: 3

PN10
PN10

Reputation: 1948

Try to match all versions:

compileSdkVersion 23 buildToolsVersion '23.0.0' targetSdkVersion 23

Add Following dependencies: compile 'com.android.support:appcompat-v7:23.0.0'

Make sure you use latest version of Sdk: how to update sdk

Upvotes: 0

Androider
Androider

Reputation: 3873

Please use my project gradle values and also update sdk libraries:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        multiDexEnabled true
        applicationId "com.example.student"  //change as your package name
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'



    compile 'com.android.support:appcompat-v7:23.0.1'


}

Upvotes: 0

Rashpal Singh
Rashpal Singh

Reputation: 633

Try it

compile "com.android.support:appcompat-v7:23.0.1"

and you can change targetSdkVersion 23

Upvotes: 0

Related Questions