Categories

Tags

None

    Recent Comments

    MapActivity cannot be resolved to a type

    When I first working on with MapActivity, I got above error. I kept press Ctrl+Shift+O. However, the type just wouldn’t resolve. Finally I found the answer on the Internet. You need to change the build target to “Google API”
    Right click on the project. Go to “Properties”. Change the “Build Target” from “Android 1.x to Google APIs 1.x”
    image

    January 14, 2010 23:58 by Admin
    E-mail | Permalink | Comments (4) | Comment RSSRSS comment feed

    Comments

    October 11. 2010 22:37

    Carlos

    Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks !

    Carlos

    October 11. 2010 22:37

    水的影子

    thanks for this useful article

    水的影子

    October 11. 2010 22:37

    leakleakleak

    Hey all! I had the same issue even though I had started a new project using Google API right from the get-go. The fix was to make sure to import the com.google.android.maps.MapActivity class. So in the example, you should have something like this:

    import android.app.Activity;
    import android.os.Bundle;
    import com.google.android.maps.MapActivity;

    That fixed it for me!

    leakleakleak

    October 11. 2010 22:37

    J.D.

    Thanks for this post.  I was going crazy trying to find why "MapActivity cannot be resolved to a type".  After reading your post, I found the Google APIs for Android, installed them, and then set the target as per your screenshot, and all the compile errors went away.

    J.D.