java.lang.RuntimeException: Unable to instantiate activity ComponentInfo…

I am trying to integrate Google Map in my application that I am working on and I ran into this nicely said error:
[2010-12-23 01:34:03 - Emulator] E/AndroidRuntime( 304): java.lang.RuntimeException:

Unable to instantiate activity ComponentInfo{}: java.lang.ClassNotFoundException: in loader dalvik.system.PathClassLoader[/data/]

This is my XML:

< com 		
android:id="@+id/mapView" android:layout_width="fill_parent" 		
android:layout_height="fill_parent" android:enabled="true" 		

android:clickable="true" android: apiKey="your_received_key" />

This is a snippet from the Manifest XML:

< application android:icon="@drawable/icon" 
< uses - library android:name="" / >
< activity android:name=".MainActivity" android:label="@string/app_name">
< intent-filter>
< action android:name="android.intent.action.MAIN"  / >
< category android:name="android.intent.category.LAUNCHER" / >
< / intent-filter>
< / activity>

And a snippet of code from the Java class:

// Obtain handles to UI objects
final MapView mapView = (MapView) findViewById(;

At this moment the code runs with no errors, but before I made the mistake of moving in

the manifest xml file this line : down some lines to “group” some lines(permissions all together, activities all together) but it was a stupid mistake not understanding that this means ” my declared activity USES this library”. So…after one hour of thinking what did I do wrong and googling about it, i found this this and then realised I started right

but … :) Keep in mind(I sure will) to add whatever libraries you are using in your application between

the declaration lines of the application itself in the AndroidManifest.xml file. If you still get the title error message, feel free to leave a comment here.

Posted in Android by gabriela.radu at December 23rd, 2010.
Tags: ,

Leave a Reply