Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps v2 in the Android Studio. Not found GeoPoint

I am working on a code that was made in the Eclipse and i am migrating to Android Studio, however i am having a problem to the to import
com.google.android.maps.GeoPoint;
but i can import
com.google.android.gms.maps.GoogleMap;

I've tried to add in my Gradle file
compile 'com.google.android.gms:play-services:6.5.87'
and also i've tried also to use .jar, however i didn't have good results.
compile files('libs/google-play-services.jar')

I searched about this in many places, but i found nothing to help me, case somebody have resolved this problem and want help me i thank you.

like image 830
Busata Avatar asked Feb 23 '15 19:02

Busata


2 Answers

To work, i had that to replace the below line in the my Gradle file.

android {
    ...
    compileSdkVersion 16
    ...
}

To

android {
    ...
    compileSdkVersion "Google Inc.:Google APIs:16"
    ...
}


like image 194
Busata Avatar answered Nov 09 '22 10:11

Busata


Please following all the steps to Add Google Play Services to Your Project in Android Studio:

1.Open the build.gradle file inside your application module directory. Note: Android Studio projects contain a top-level build.gradle file and a build.gradle file for each module. Be sure to edit the file for your application module. See Building Your Project with Gradle for more information about Gradle.

2.Add a new build rule under dependencies for the latest version of play-services. For example:

apply plugin: 'com.android.application'
...

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

Be sure you update this version number each time Google Play services is updated. Note: If the number of method references in your app exceeds the 65K limit, your app may fail to compile. You may be able to mitigate this problem when compiling your app by specifying only the specific Google Play services APIs your app uses, instead of all of them. For information on how to do this, see Selectively compiling APIs into your executable.

3.Save the changes and click Sync Project with Gradle Files in the toolbar.

4.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" />

You can now begin developing features with the Google Play services APIs.

Please refer to here for more details.

like image 44
bjiang Avatar answered Nov 09 '22 11:11

bjiang