Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Google Play Services for Froyo to the project using Gradle?

Information from Google Developers Portal:

  1. Open the build.gradle file inside your application directory.
  2. Add a new build rule under dependencies for the latest version of play-services. For example:
apply plugin: 'android'
...

dependencies {
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.google.android.gms:play-services:4.0.30'
}

But this is instruction for standart Google Play Services. Google Play Services for Froyo is a different module. I've never worked with Gradle - what I need to do to add Google Play Services for Froyo?

like image 701
bvitaliyg Avatar asked Dec 15 '13 00:12

bvitaliyg


1 Answers

If you download "Google Play services for Froyo" library using the Android SDK Manager (under the "Extras" category towards the bottom), you should be able to see the current version number in the AndroidManifest.xml bundled with the google_play_services_froyo library, in <Android SDK Home>\extras\google\google_play_services_froyo\libproject\google-play-services_lib.

On my computer, AndroidManifest.xml for Google Play Services for Froyo looks like this:

<?xml version="1.0" encoding="UTF-8"?> <manifest android:versionName="3.2.65 (834000-30)" 
  android:versionCode="3265130" package="com.google.android.gms" 
  xmlns:android="http://schemas.android.com/apk/res/android"><uses-sdk 
  android:minSdkVersion="8"/></manifest>

You should then be able to use this version name (the first part) with Gradle:

dependencies {
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.google.android.gms:play-services:3.2.65'
}

Just make sure you also have the latest versions of "Google Repository" and "Android Support Repository" also installed via the Android SDK Manager (also under the "Extras" category).

like image 182
Sean Barbeau Avatar answered Dec 11 '22 08:12

Sean Barbeau