Skip to content Skip to sidebar Skip to footer

Mapactivity Error: Force Close

I created a new MapActivity class MapProba. From main Activity I want to show MapActivity: on button click event I put this code: Intent myIntent = new Intent(this, com.art.mod

Solution 1:

I had the same problem, you have to put this tag in your AndroidManifest.xml

<uses-libraryandroid:name="com.google.android.maps"/>

It should be inside:

<application><uses-libraryandroid:name="com.google.android.maps"/></application>

!!!!never, never outside

and use this on yous activity

Intent myIntent = newIntent(getBaseContext(), MapProba.class);             
startActivity(myIntent);  

Solution 2:

Can you send more of the error log, what comes right after

XML file line #7: Error inflating class com.google.android.maps.MapView ...

It will probably tell why it was not able to inflate this class, whether it is not present, or it is missing libraries...etc...

-- After your update --

What kind of device are you running this on ?

If you use the emulator, you need to use the Google API as your build target.

If you use a real device, it should just work fine on a G1, but if it is a device where you ported Android from AOSP, you most likely do not have the right libraries installed.

Specifically, you should have files like com.google.android.maps.jar and com.google.android.maps.xml There is a good tutorial there to use the mapview : http://developer.android.com/resources/tutorials/views/hello-mapview.html

Solution 3:

If you are using an external device for debugging most probably it does not have the right libraries installed.

Especially for archos users check this out http://code.google.com/p/archos-apps-installer/downloads/detail?name=gAppsInstaller_v5-final.apk

Solution 4:

On your Maps form class, did you use extends MapActivity instead of extends Activity? That screw me for awhile before I realized that I was using the wrong extended class. :P

Post a Comment for "Mapactivity Error: Force Close"