eclipse android can not import google play services library

前端 未结 5 787
攒了一身酷
攒了一身酷 2021-01-29 07:07

hello i am quite new to Android development and i want to learn how to use the google Maps API v2. After trying numerous tutorials, i always seem to have a problem with the goog

5条回答
  •  长发绾君心
    2021-01-29 07:29

    Eclipse

    • Copy the library project at

    /extras/google/google_play_services/libproject/google-play-services_lib/

    to the location where you maintain your Android app projects.

    • Import the library project into your Eclipse workspace. Click

    File > Import, select Android > Existing Android Code into Workspace

    and browse to the copy of the library project to import it.

    • After you've added the Google Play services library as a dependency for your app project, open your app's manifest file and add the following tag as a child of the element:
    < meta-data android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
    

    Android Studio

    • Open the build.gradle file inside your application module directory.
    • Add a new build rule under dependencies for the latest version of play-services eg
        ...
        dependencies {
            compile 'com.google.android.gms:play-services:9.2.0'
        }
    apply plugin: 'com.android.application'
    

    Source developers.google.com

提交回复
热议问题