Sunday, February 5, 2012

MapActivity cannot be resolved to a type

So I got this error while trying to create an Android project to use Google Maps.

The thing is, my project's target was Android 2.3.3. It should have been Google API (whatever version). If you don't have a Google API for your device's API version (I didn't), just open Window->SDK Manager and download a Google API for your version.

Then change your project's target API: right click on your project -> Configure -> Android, and choose your version.

After that, you also need to import the google maps package.

import com.google.android.maps.MapActivity


That's it, you're done!

No comments:

Post a Comment