29

This question is no longer valid. But answers may still be useful for others, so I will leave it here.


Original question:

In a blogpost from 17 november, Google guys introduced long awaited granular dependency management (to cope with dex method limit). We have december 8th and I still cannot download the sdk (6.1 is the latest available), nor get the documentation on how to introduce granular dependency. Any news on this one? Or an idea how to get it before it's officialy released?

Michał Klimczak
  • 12,674
  • 8
  • 66
  • 99
  • 1
    I think that's the kind of question you should ask directly from the Google developers. The only answers we (people not affiliated with the Google) can give are: there is no way to get it before release, and it'll be released when it's done. :) – aga Dec 08 '14 at 08:04
  • I had answers from googlers several times, I hope they'll see that question :) – Michał Klimczak Dec 08 '14 at 08:06
  • I think we have to wait. In the blogpost there are descriptions of new API, but in the web site there is any new description (for example for the new getMapAsync()) – greywolf82 Dec 08 '14 at 08:20
  • 1
    This question appears to be off-topic because it is about a product's timeline, and should be asked to the developers or company. – gunr2171 Dec 11 '14 at 18:29

3 Answers3

68

Note!

I will no longer be maintaining this answer, because Google is doing a very good job at doing the releases now. With a post on their Android Developers Blog, official release notes and often also a video on their YouTube channel with a short overview of what's new.

I'll leave the last two (as of writing) updates and the original answer. Please find the previous updates here

Update October 2016, Play Services 9.8.0

Google Play Services Release Notes, Google Maps APIs Release Notes

support-v4 dependency

com.google.android.gms:play-services-base:9.8.0
-> com.google.android.gms:play-services-basement:9.8.0
  -> com.android.support:support-v4:24.0.0 -> 24.2.1

Update May 2016, Play Services 9.0.1

Blog Post, Google Play Services Release Notes, Google Maps APIs Release Notes

# Google+
compile com.google.android.gms:play-services-plus:9.0.1
# Google Account Login
compile com.google.android.gms:play-services-auth:9.0.1
# Google Actions, Base Client Library
compile com.google.android.gms:play-services-base:9.0.1
# Google Address API
compile com.google.android.gms:play-services-identity:9.0.1
# Google App Indexing
compile com.google.android.gms:play-services-appindexing:9.0.1
# Google App Invites
compile com.google.android.gms:play-services-appinvite:9.0.1
# Google Analytics
compile com.google.android.gms:play-services-analytics:9.0.1
# Google Cast
compile com.google.android.gms:play-services-cast:9.0.1
# Google Cloud Messaging
compile com.google.android.gms:play-services-gcm:9.0.1
# Google Drive
compile com.google.android.gms:play-services-drive:9.0.1
# Google Fit
compile com.google.android.gms:play-services-fitness:9.0.1
# Google Location, Activity Recognition, and Places
compile com.google.android.gms:play-services-location:9.0.1
# Google Maps
compile com.google.android.gms:play-services-maps:9.0.1
# Google Mobile Ads
compile com.google.android.gms:play-services-ads:9.0.1
# Mobile Vision
compile com.google.android.gms:play-services-vision:9.0.1
# Google Nearby
compile com.google.android.gms:play-services-nearby:9.0.1
# Google Panorama Viewer
compile com.google.android.gms:play-services-panorama:9.0.1
# Google Play Game services
compile com.google.android.gms:play-services-games:9.0.1
# SafetyNet
compile com.google.android.gms:play-services-safetynet:9.0.1
# Android Pay
compile com.google.android.gms:play-services-wallet:9.0.1
# Android Wear
compile com.google.android.gms:play-services-wearable:9.0.1

Update December 2015, Play Services 8.4.0

Blog Post, Video, Google Play Services Release Notes, Google Maps APIs Release Notes

dependencies {
    # Google+   
    compile com.google.android.gms:play-services-plus:8.4.0
    # Google Account Login  
    compile com.google.android.gms:play-services-auth:8.4.0
    # Google Actions, Base Client Library   
    compile com.google.android.gms:play-services-base:8.4.0
    # Google Address API    
    compile com.google.android.gms:play-services-identity:8.4.0
    # Google App Indexing   
    compile com.google.android.gms:play-services-appindexing:8.4.0
    # Google App Invites    
    compile com.google.android.gms:play-services-appinvite:8.4.0
    # Google Analytics  
    compile com.google.android.gms:play-services-analytics:8.4.0
    # Google Cast   
    compile com.google.android.gms:play-services-cast:8.4.0
    # Google Cloud Messaging    
    compile com.google.android.gms:play-services-gcm:8.4.0
    # Google Drive  
    compile com.google.android.gms:play-services-drive:8.4.0
    # Google Fit    
    compile com.google.android.gms:play-services-fitness:8.4.0
    # Google Location, Activity Recognition, and Places 
    compile com.google.android.gms:play-services-location:8.4.0
    # Google Maps   
    compile com.google.android.gms:play-services-maps:8.4.0
    # Google Mobile Ads 
    compile com.google.android.gms:play-services-ads:8.4.0
    # Mobile Vision 
    compile com.google.android.gms:play-services-vision:8.4.0
    # Google Nearby 
    compile com.google.android.gms:play-services-nearby:8.4.0
    # Google Panorama Viewer    
    compile com.google.android.gms:play-services-panorama:8.4.0
    # Google Play # Game services   
    compile com.google.android.gms:play-services-games:8.4.0
    # SafetyNet 
    compile com.google.android.gms:play-services-safetynet:8.4.0
    # Google Wallet 
    compile com.google.android.gms:play-services-wallet:8.4.0
    # Android Wear  
    compile com.google.android.gms:play-services-wearable:8.4.0
}

support-v4 dependency

com.google.android.gms:play-services-base:8.4.0
-> com.google.android.gms:play-services-basement:8.4.0
  -> com.android.support:support-v4:23.0.0 -> 23.4.0

Update August 2015, Play Services 7.8.0

Google Play Services Release Notes, Google Maps APIs Release Notes

support-v4 dependency

com.google.android.gms:play-services-base:7.8.0
-> com.android.support:support-v4:22.2.0 -> 22.2.1

Original answer

They have just been released (see the highlights). You can find more information on how to use the granular dependencies here.

You will need to update your local Google Play Services repository using the SDK Manager provided by the SDK or use a plugin like Jake Whartons sdk-manager-plugin for Gradle which will automatically update it for you. It would look like this when building with Gradle:

Google Play Services repository outdated. Downloading update...

Edit 1

As of writing, the second link seem to be corrupt, as in, even though Using Android Studio is selected in the drop down menu, it doesn't show the information, at least for me. In order to see the information for Android Studio, select Using something else, then select Using Android Studio again.

Edit 2

Google Maps APIs Release Notes

dependencies {
    # Google+'
    compile 'com.google.android.gms:play-services-plus:6.5.+'
    # Google Account Login
    compile 'com.google.android.gms:play-services-identity:6.5.+'
    # Google Activity Recognition
    compile 'com.google.android.gms:play-services-location:6.5.+'
    # Google App Indexing
    compile 'com.google.android.gms:play-services-appindexing:6.5.+'
    # Google Cast
    compile 'com.google.android.gms:play-services-cast:6.5.+'
    # Google Drive
    compile 'com.google.android.gms:play-services-drive:6.5.+'
    # Google Fit
    compile 'com.google.android.gms:play-services-fitness:6.5.+'
    # Google Maps
    compile 'com.google.android.gms:play-services-maps:6.5.+'
    # Google Mobile Ads
    compile 'com.google.android.gms:play-services-ads:6.5.+'
    # Google Panorama Viewer
    compile 'com.google.android.gms:play-services-panorama:6.5.+'
    # Google Play Game services
    compile 'com.google.android.gms:play-services-games:6.5.+'
    # Google Wallet
    compile 'com.google.android.gms:play-services-wallet:6.5.+'
    # Android Wear
    compile 'com.google.android.gms:play-services-wearable:6.5.+'
    # Google Actions
    # Google Analytics
    # Google Cloud Messaging
    compile 'com.google.android.gms:play-services-base:6.5.+'
}

support-v4 dependency

com.google.android.gms:play-services-base:6.5.87
-> com.android.support:support-v4:21.0.0 -> 21.0.3

Edit 3

Google just made a blog post about Google Play Services 6.5 and the 65k method limit. It contains the information of my post and more. I'll just quote one paragraph for anyone who comes across this information via SO instead of the blog post:

Note: At the time of writing, the correct version to use is 6.5.87. As this is a very granular number, it will get updated quite quickly, so be sure the check the latest version when you are coding. Often people will use a ‘+’ to denote versions, such as 6.5.+ to use the latest 6.5 build. However, it’s typically discouraged to use a ‘+’ as it can lead to inconsistencies.

JJD
  • 50,076
  • 60
  • 203
  • 339
aried3r
  • 1,118
  • 13
  • 17
  • When I try to compile my app using this granular dependency, I get the following error: Error:Execution failed for task ':app:processDebugResources'. > Error: **more than one library with package name 'com.google.android.gms'** You can temporarily disable this error with android.enforceUniquePackageName=false However, this is temporary and will be enforced in 1.0 – shaithana Dec 10 '14 at 00:54
  • Can you post your `build.gradle` file? – aried3r Dec 10 '14 at 17:56
  • 1
    android { compileSdkVersion 21 buildToolsVersion '20.0.0' defaultConfig { applicationId 'xxxxxxxx' minSdkVersion 16 targetSdkVersion 20 versionCode 01 versionName 'xxx' } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } } – shaithana Dec 10 '14 at 18:20
  • dependencies { compile files('libs/pixlui-1-0-5.jar') compile group: 'com.squareup.picasso', name: 'picasso', version: '2.3.2' compile files('libs/androidasync-1.2.8.jar') compile files('libs/ion-1.2.9.jar') compile files('libs/gson-2.2.4.jar') compile 'com.android.support:appcompat-v7:21.0.2' compile 'com.google.android.gms:play-services-maps:6.5.+' compile 'com.google.android.gms:play-services-location:6.5.+' compile 'com.google.maps.android:android-maps-utils:0.3' compile project(':facebook') compile project(':library') } – shaithana Dec 10 '14 at 18:20
  • sorry is too long for just 1 comment. – shaithana Dec 10 '14 at 18:21
  • Next time use a Gist or pastebin maybe. I'll answer in your other question http://stackoverflow.com/questions/27402145/play-service-granular-dependency-error – aried3r Dec 10 '14 at 18:39
  • Giovanni: perhaps you have a library project where you need to modify the dependency as well? – emidander Dec 22 '14 at 13:36
  • @aried3r Do you know where I can find a mapping between what libraries are included in each granular dependency reference? For example, If I need to import com.google.android.gms.auth.GoogleAuthUtil and com.google.android.gms.common.AccountPicker, what's the least number (most granular) dependencies I need to take? – Arash Motamedi Sep 14 '15 at 02:27
  • @Arash, sorry, I don't. – aried3r Sep 24 '15 at 20:59
4

There is a lack of documentation in Android site.

appstate is not included, and if you're using Game Helpers you're fuc***

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

from this post

Jared Burrows
  • 54,294
  • 25
  • 151
  • 185
cesards
  • 15,882
  • 11
  • 70
  • 65
3

I dug around the SDK maven repo to figure this out, and it seems to be working for me so far. The following directory contains the split dependencies: <path-to-sdk>/extras/google/m2repository/com/google/android/gms/.

I unzipped some AARs and the contents suggest that play-services contains everything and play-services-basecontains the minimum requirements which you can build upon by including the other dependencies (e.g. play-services-location, play-services-maps, play-services-wallet).

Your dependencies section might look like this:

dependencies {
    compile 'com.google.android.gms:play-services-location:6.5.87'
    compile 'com.google.android.gms:play-services-maps:6.5.87'
    compile 'com.google.android.gms:play-services-wallet:6.5.87'
}
Jared Burrows
  • 54,294
  • 25
  • 151
  • 185
Michael Pardo
  • 2,590
  • 3
  • 24
  • 33