jzapata
jzapata

Reputation: 1229

Is it safe to compile with an older version of Google Play Services?

I like to stay as current as possible with libraries, but on a project I started a year ago I was on Eclipse and was using Google Play Service for Froyo. I recently started using Android Studio and of course now have a lot of broken code because I was initially using the most recent version of Google Play Services.

To fix it I basically imported the old Google Play Service for Froyo Eclipse project and made it a module in Android Studio that I referenced. I do not necessarily need the new features of the libarary and it is working. Here is my question: Is it safe to do this? I don't want this to bite me on newer devices.

Upvotes: 1

Views: 2010

Answers (1)

ianhanniballake
ianhanniballake

Reputation: 200120

All newer versions of Google Play services (the app) are backward compatible with all previous versions of the SDK, meaning code compiled with an older SDK will continue to work even as Google Play services gets updated on every device.

Note that 'Google Play Services for Froyo' is in fact just the last version of Google Play services that supports Froyo - 3.2.65 (it was Google Play services 4.0 which dropped support of Froyo). If you are using Gradle, you can still reference that in your build.gradle file without the need to import it as a module:

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

}

You can see the full list of Google Play services versions available via Gradle by looking in the {android-sdk}/extras/google/m2repository/com/google/android/gms/play-services directory, which currently lists the following versions: 3.1.36, 3.1.59, 3.2.25, 3.2.65, 4.0.30, 4.1.32, 4.2.42, 4.3.23, 4.4.52, 5.0.89, 6.1.11, 6.1.71, 6.5.87, and 7.0.0.

You should strongly consider stepping through each version fixing issues as they come up as each release has a considerable number of fixes. In particular, Google Play services 6.5 offers the ability to selectively include APIs so your application only includes the APIs you actually use.

Upvotes: 2

Related Questions