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

前端 未结 1 564
灰色年华
灰色年华 2020-12-08 23:33

Information from Google Developers Portal:

  1. Open the build.gradle file inside your application directory.
  2. Add a new build rule under
相关标签:
1条回答
  • 2020-12-09 00:36

    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).

    0 讨论(0)
提交回复
热议问题