Josh
Josh

Reputation: 6393

What is the best way to add Google Play Service dependencies on Android Studio?

I have added Google Play Service dependencies to Android Studio. I want something that works today and in the near future, something that keeps my app code up to date, without having to worry about every new Play service release, if possible.

Currently, I have this:

dependencies {
    compile 'com.google.android.gms:play-services:7.5.0'
}

Is this the best way to add Google Play Service dependencies on Android?

Upvotes: 1

Views: 118

Answers (1)

Uli
Uli

Reputation: 3016

You can use the following to always build against the latest available Google Play Services version:

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

However you will get a warning from Android Studio indicating that your builds are potentially non-repeatable and your code may break at any time (and you may not know why) due to changing versions behind the scenes. It's a trade-off. For a little more control you can use one of these:

compile 'com.google.android.gms:play-services:7.+'
compile 'com.google.android.gms:play-services:7.5.+'

Upvotes: 2

Related Questions