import com.google.android.maps.geopoint cannot be

2019-03-25 05:37发布

问题:

I have Java GoogleMAP project.This is not android project. I have done this project previous using KML. Now Google has changed to JSON/XML. I need to save coordinates within 2 location in database -postgresql. Then accroding to that i will draw the path in MAP.

Now the problem is : GeoPoint cannot be resolved to a type . I import like this also import com.google.maps.GeoPoint;. This also show as red mark. Please let me know what is an issues or problem?

I google it. No luck. All are mention about android google api setup.

Not an android project...

please help me..

Thanks in advance.

回答1:

Go to project properties, and go to Android. Select "Google API" instead of Android x.x. It works for me and ideally should work for you too.



回答2:

exactly works fine for me project properties > android > platform > Google API 10

and Clean :) .First download the Google API version you require using SDK Manager!



回答3:

You need to compile your project with Google APIs.

  1. install Google APIs SDK

  1. Compile the project project with Google APIs

  1. You need to add the Google APIs Add-On to your project. See this document: https://developers.google.com/android/add-ons/google-apis/installing


回答4:

make sure you have defined at your manifest file inside application tag the following line:

<uses-library android:name="com.google.android.maps"/>


回答5:

You need to add required jars in lib and classpath. Because those jars are not in classpath your IDE couldn't resolve the location of the class you are trying to import.



回答6:

I solved by "Sync Project with Gradle Files".



回答7:

You need to add the Google APIs Add-On to your project. See this document: https://developers.google.com/android/add-ons/google-apis/installing

That's all.