Marl
Marl

Reputation: 1504

Android: Google Map V2 not working as expected using eclipse

I'm integrating google map v2 to my android app, I'm using Eclipse with minimum SDK Version version 10. I'm using a Samsung Galaxy Ace as a test device.

I've read and done the necessary steps in this site:

http://developer.android.com/google/play-services/setup.html https://developers.google.com/maps/documentation/android/start

I've also consult this tutorials:

http://www.vogella.com/articles/AndroidGoogleMaps/article.html http://www.androidhive.info/2013/08/android-working-with-google-maps-v2/

The problem is that the google-play-service_lib seems to be not included although I have done the step Project > Properties > Android > Add: google-play-service_lib

Here is a screenshot:

enter image description here

I've tried solving this problem by doing Project > Properties > Java Build Path and adding the google-play-service_lib, but this will cause a runtime error java.lang.noclassdeffounderror: com.google.android.gms.R$styleable

Has anyone encounter this problem, and how did you solve this?

Project > Properties > Java Build Path

Upvotes: 1

Views: 310

Answers (3)

Piyush
Piyush

Reputation: 18933

enter image description hereThe problem is because when you are importing lib project at that time you haven't copy that project in to workspace.

So finally when import it enable "Copy to Workspace" checkbox.

And after that give a reference to your project like below image.

Upvotes: 1

GrIsHu
GrIsHu

Reputation: 23638

As you said

I add the library project, it is green. But when I visit the Project > Properties > Android part again, it will be red.

Just copy your project into your workspace or if its already copied into the workspace make sure you have also copied your Google-play-services library into your workspace otherwise it will always give you library error as it will not get the library available into your workspace.

Upvotes: 1

Kitkat
Kitkat

Reputation: 77

Make sure that your project code and google-play-service_lib's code are at same place otherwise it will keep fireing import error.

Upvotes: 2

Related Questions