2

After updating sdk tools and google play services to 6.5.87 I now couldn´t find com.google.android.gms in my android project (android studio). How could I fix this problem?

One of errors is now: error: cannot find symbol class ActivityRecognitionClient

dependencies {

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

}

user3890967
  • 43
  • 1
  • 6

2 Answers2

5

With version 6.5, Google separated Play Services into multiple smaller dependencies.

Here is the complete list of possible dependencies:

com.google.android.gms:play-services-base:6.5.87
com.google.android.gms:play-services-ads:6.5.87
com.google.android.gms:play-services-appindexing:6.5.87
com.google.android.gms:play-services-maps:6.5.87
com.google.android.gms:play-services-location:6.5.87
com.google.android.gms:play-services-fitness:6.5.87
com.google.android.gms:play-services-panorama:6.5.87
com.google.android.gms:play-services-drive:6.5.87
com.google.android.gms:play-services-games:6.5.87
com.google.android.gms:play-services-wallet:6.5.87
com.google.android.gms:play-services-identity:6.5.87
com.google.android.gms:play-services-cast:6.5.87
com.google.android.gms:play-services-plus:6.5.87
com.google.android.gms:play-services-appstate:6.5.87
com.google.android.gms:play-services-wearable:6.5.87
com.google.android.gms:play-services-all-wear:6.5.87

Prior to version 6.5, you would typically have a line like this in your build.gradle file:

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

Starting with version 6.5, of Google Play services, you’ll be able to pick from a number of individual APIs, and you can see which ones have their own include files in the documentation. For example, if all you want to use is Maps, you would instead have:

compile 'com.google.android.gms:play-services-maps:6.5.87'

Note that this will transitively include the ‘base’ libraries, which are used across all APIs. You can include them independently with the following line:

compile 'com.google.android.gms:play-services-base:6.5.87'

Reference:

http://android-developers.blogspot.pt/2014/12/google-play-services-and-dex-method.html

Christian Göllner
  • 5,808
  • 4
  • 19
  • 20
4

ActivityRecognitionClient was deprecated, and they may have gotten rid of deprecated methods. Either use an earlier version of the artifact, or switch to ActivityRecognition, which I think is the replacement.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thank you for your answer. Now it works. Also I had to change my code because of the LocationClient who is now deprecated. http://stackoverflow.com/questions/24611977/android-locationclient-class-is-deprecated-but-used-in-documentation – user3890967 Dec 10 '14 at 19:27