Reputation: 1504
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:
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?
Upvotes: 1
Views: 310
Reputation: 18933
The 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
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
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