Wednesday, December 19, 2012

Add reference library google-play-services.jar to project using MapFragment and SupportMapFragment

To use MapFragment or SupportMapFragment on your Android App, you have to add reference library google-play-services.jar to your project. Otherwise, ClassNotFoundException will be thrown caused by or

To add reference library google-play-services.jar:

- Right click on your project, select Properties.

- Select Android on the left selection, scroll down to the Library at right, and click Add.

- Select google-play-services_lib and click OK.

- Apply and click OK.

The series:
A simple example using Google Maps Android API v2, step by step.

Remark: Somebody report that ClassNotFOundException still happen even added reference library google-play-services.jar! Refer to comments in the post Using SupportMapFragment. So anybody have any other suggestion, please share in comments. Thanks.

- Tips to add Support Library


Nayanesh Gupte said...

my colleague faced the same issue. but then while searching on internet i came across this
blog .
he is also using same lib as that of you but its working smoothly.
I'll try to ask him that from where did he downloaded lib.

Gibran Castillo said...

I does not work with Google Play services v6 (latest), you have to do it with v4. At least when using an Emulator.

kevin said...

Hey, I am referencing that library, but once I run the app on emulator the same ClassNotFoundException is found, and when I go back to my reference the library is marked with a "X"(red) and not a TICK(green)

Anonymous said...

In my google-play-services.jar there is a class called in this class google docs docs says it has a method named flat
which is missing in my jar

I wanted to know if same is missing in your jar file as well