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 com.google.android.gms.maps.MapFragment or com.google.android.gms.maps.SupportMapFragment.
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.
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