Google Play Services generating errors

Asked

Viewed 243 times

0

Hello. To add the Google Play Services the dependencies, the image error is shown. I have no idea why, or how to fix it.

  • The error is only shown in the file values-21.xml
  • After remove the Google Play Services of the dependencies, the error seems to be fixed, being possible to perform the compilation normally.

inserir a descrição da imagem aqui

Gradle:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.android.gms:play-services:7.8.0'
}
  • How is your compileSdkVersion?

  • @ramaral compileSdkVersion 19 buildToolsVersion "19.1.0" defaultConfig { minSdkVersion 16 targetSdkVersion 19 }

2 answers

1


The problem is because you’re declaring compileSdkVersion=19.

The archive values-21.xml uses Resources which only exist as of version 21.

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

If you haven’t already, do the download of the latest version of the available Android API, which on this date is 6.0 API 23. Also update the Tools for the latest version.

Once done, change the value of compileSdkVersion to 23

  • ramaral, the problem of values-21.xml is because he’s using the appcompat-v7:22.2.0, and the values-21.xml belongs to the appcompat (could not remove), which requires the app to be compiled with version 21 android, da para ver isso pelo caminho do arquivo que fica na topo. Otherwise I fully agree with your answer :D

  • @Wakim. So, if I understood correctly, what is not correct in my answer would be just the possibility to remove the file, right?.

  • Exactly, it does not belong to the app yes, it is internal appcompat-v7 in the version 22.2.0.

  • @Wakim Thanks, I’ll edit the answer

0

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

Also checks that your play services SDK is up to date on the latest Revision 27.

  • It didn’t. Yes, it’s in Revision 27. I made sure to update it before adding Play Services.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.