1

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

USER9561
  • 1,084
  • 3
  • 15
  • 41
finux
  • 11
  • 1
  • try using this `compile 'com.android.support:appcompat-v7:21.1.0'` – USER9561 Sep 19 '16 at 11:33
  • Use latest support library and compile against latest sdk. [check this](http://stackoverflow.com/questions/32075498/error-retrieving-parent-for-item-no-resource-found-that-matches-the-given-name) – Raghavendra Sep 19 '16 at 11:36
  • check https://code.google.com/p/android/issues/detail?id=183149 – piotrek1543 Sep 19 '16 at 16:07

5 Answers5

3

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

Rashpal Singh
  • 633
  • 3
  • 13
USER9561
  • 1,084
  • 3
  • 15
  • 41
0

Try it

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

and you can change targetSdkVersion 23

Rashpal Singh
  • 633
  • 3
  • 13
0

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'


}
Androider
  • 3,833
  • 2
  • 14
  • 24
0

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

PN10
  • 1,888
  • 3
  • 23
  • 34
  • i have used your answer and it's working and know what to say – finux Sep 19 '16 at 12:04
  • @finux see this is how You accept an answer on stackoverflow do this..http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – PN10 Sep 19 '16 at 12:18
0

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

piotrek1543
  • 19,130
  • 7
  • 81
  • 94