Google Play Services generating errors

0

Hello. When you add Google Play Services dependencies, the image error is displayed. I have no idea what the reason is, or how to solve it.

  • The error is only displayed in the values-21.xml
  • After remove Google Play Services from the dependencies, the error seems to be fixed, being able to compile normally.

Gradle:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.android.gms:play-services:7.8.0'
}
    
asked by anonymous 30.10.2015 / 20:43

2 answers

1

The problem is that you are declaring compileSdkVersion=19 .

The file values-21.xml uses resources that only exist as of version 21.

The application will therefore have to be compiled with at least version 21 of Android. However, ideally you should always compile your project using the most current version of the SDK.

If you have not already done so, download the latest version of the available Android API, which on this date is 6.0 API 23. Also update the Tools for the last version.

Once this is done, change the value from compileSdkVersion to 23

    
31.10.2015 / 15:06
0

It seems like some problem with Gradle, go to Tools > Android > Sync Project with Gradle Files and see if it works out.

Also check to see if your play services SDK is updated in the last revision 27.

    
30.10.2015 / 21:14