0

I have a problem in my build.gradle file, the compileSdkVersion and buildToolsVersion doesn't match.

Here is my build.gradle:

    apply plugin: 'com.android.application'

    android {
    compileSdkVersion 22
    buildToolsVersion '23.0.2'

    defaultConfig {
        applicationId "com.emergencyapp"
        minSdkVersion 18
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        preDexLibraries = false
    }
    }

    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:design:22.2.1'
    compile 'com.jakewharton:butterknife:6.1.0'
    compile 'com.google.android.gms:play-services:8.4.0'
    }

And here is my error:

enter image description here

I think it is the buildToolsVersion and the dependencies are causing the problem.

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
  • 1
    You need to set `targetSdkVersion 23` instead of 22 – Volodymyr Feb 08 '16 at 08:18
  • 1
    @vovaxo It is not correct. You need to compile with 23, but you can still use the target 22. – Gabriele Mariotti Feb 08 '16 at 08:57
  • 1
    Possible duplicate of [Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23](http://stackoverflow.com/questions/32075498/error-retrieving-parent-for-item-no-resource-found-that-matches-the-given-name) – ʍѳђઽ૯ท Feb 08 '16 at 09:04

4 Answers4

2

Since you are using

compile 'com.google.android.gms:play-services:8.4.0'

You have a dependency with the support libraries v.23, also if you are declaring v22.
It means that you have to compile with api 23.

Just use:

compileSdkVersion 23

Otherwise use an older version of the com.google.android.gms:play-services

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
0

I was having the same problem, What I did is

  1. First be sure that you have API level 23 (marshmallow/ android 6) installed.
  2. Set compileSdkVersion to 23 and dependencies libraries also to greater than 23.
  3. Clean and build the project.
Shree Krishna
  • 8,474
  • 6
  • 40
  • 68
0

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

Since you are using version 23 of the SupportLibrary, you need to compile against version 23 of the Android SDK.

Just change your compile sdk to 23, already has an answer from Google:

https://code.google.com/p/android/issues/detail?id=183149

compileSdkVersion 23
Community
  • 1
  • 1
ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
-1

please set targetSdkVersion 23 and dependencies

Pratik
  • 456
  • 4
  • 18