Add Google Play Services to Android Studio using Gradle

后端 未结 8 1426
萌比男神i
萌比男神i 2020-12-24 03:23

Im working on simple map app, I added google-play-services.jar and its reference to gradle

dependencies {
    compile files(\'libs/android-support-v4.jar\',          


        
8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-24 03:55

    As @Matt said, it is correct, I am here covered also which I did not find in the answer.

    To add the Google Play Service library in your application project, follow below steps :-

    1) Open the build.gradle file of your application module directory. See screenshot

    Screenshot

    2) Add new in your dependecies, here you to update the version number whenever you update the Google Play Service.

    dependencies {
        ...
        compile 'com.google.android.gms:play-services:4.2.42'
        compile files('src/main/libs/gson-2.2.4.jar')
    
    }
    

    3) Now Lastly important save your file and click on Sync with Gradle Files Iconin the toolbar.

提交回复
热议问题