Brian Var
Brian Var

Reputation: 6227

App crashing in activity that implements Google maps API

I have the following activity in my app that sets a geo location on a map fragment but when I click the activity in my testing it crashes with the following errors:

http://pastebin.com/6QhdL7z9

I looked through the errors but I can't make sense of why it is crashing as its referring to main as one of the reasons.

This is where I'm calling the code in the onCreate() for reference:

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_map_gmit);
        /*map = (MapView)findViewById(R.id.map);
        map.setBuiltInZoomControls(true);*/

        //code to add a map marker at GMIT geographic location


        GoogleMap mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
        mMap.addMarker(new MarkerOptions()
                .position(new LatLng(53.271900177, -9.04889965057))
                .title("GMIT Galway Location"));;


    }

Upvotes: 0

Views: 1000

Answers (1)

DieselPower
DieselPower

Reputation: 738

Android Studio or Eclipse?

Did you try searching on SO? ;) com.google.android.maps.MapView ClassNotFoundException Android - Google Maps API v2 - NoClassDefFoundError

Sounds like you did not export the library in your project.....

Upvotes: 1

Related Questions