3

I'm trying to use the new Awareness API in an app but the only way that I can include it in my code is by using

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

in my gradle file.

I tried using

compile 'com.google.android.gms:play-services-awareness:9.2.0'

but it doesn't seem to exist.

Does anyone know what the correct compile path for selective compile of the awareness API is?

Thanks in advance.

joaomgcd
  • 5,287
  • 4
  • 28
  • 39

2 Answers2

7

It actually does exist.

//Awareness API

compile 'com.google.android.gms:play-services-contextmanager:9.2.0'
buddhabath
  • 664
  • 1
  • 10
  • 22
  • Awesome! :) Worked! Just curious how you found that though! Where can I look the next time I have this issue? – joaomgcd Jun 29 '16 at 14:51
  • Sneaky. I guess they haven't published it under its correct name yet. Seems the Awareness API was once called ContextManager API. ;) – Xaver Kapeller Jun 29 '16 at 14:54
  • @joaomgcd You can look on Bintray - the website behind the maven repository jcenter - and look for the package in the play services group. I actually scrolled through the packages but didn't find any mention of the Awareness API. Turns out that's because its currently published under a different name. – Xaver Kapeller Jun 29 '16 at 14:57
  • 1
    You could also print the dependency graph with the gradle task `dependencies` and look for a repository that might be it. Could be that this is what @buddhabath did. – Xaver Kapeller Jun 29 '16 at 14:59
  • I was a desperate man (reached dex limit with full lib) and my googling skills are out of this world. (Found it on reddit) – buddhabath Jun 29 '16 at 15:21
  • How friendly of them to not include it in the documentation. Thank you for this!! – Viven Jul 04 '16 at 09:51
  • If anyone else stumbles on this, it is now documented for 9.4.0 at https://developers.google.com/android/guides/setup – NKijak Sep 04 '16 at 14:50
  • As of play services 9.6.0, this has been renamed to awareness. See this [question](http://stackoverflow.com/questions/39703220/google-awareness-api-v9-6-is-missing) – Ammar Oct 04 '16 at 00:28
1

Today you have to include:

compile 'com.google.android.gms:play-services-awareness:10.2.4'

If you want to know the latest Dependency you can use my web tool called DependencyLookup.

rekire
  • 47,260
  • 30
  • 167
  • 264