Reputation: 259
I am getting an error like your application has stopped unexpectedly. I have attached my logcat here. Please help me.
08-06 10:18:00.226: E/AndroidRuntime(868): FATAL EXCEPTION: main
08-06 10:18:00.226: E/AndroidRuntime(868): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.myoverlays1/com.example.myoverlays1.MyOverlays}: java.lang.ClassNotFoundException: com.example.myoverlays1.MyOverlays
08-06 10:18:00.226: E/AndroidRuntime(868): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
08-06 10:18:00.226: E/AndroidRuntime(868): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
08-06 10:18:00.226: E/AndroidRuntime(868): at android.app.ActivityThread.access$600(ActivityThread.java:130)
08-06 10:18:00.226: E/AndroidRuntime(868): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
08-06 10:18:00.226: E/AndroidRuntime(868): at android.os.Handler.dispatchMessage(Handler.java:99)
08-06 10:18:00.226: E/AndroidRuntime(868): at android.os.Looper.loop(Looper.java:137)
08-06 10:18:00.226: E/AndroidRuntime(868): at android.app.ActivityThread.main(ActivityThread.java:4745)
08-06 10:18:00.226: E/AndroidRuntime(868): at java.lang.reflect.Method.invokeNative(Native Method)
08-06 10:18:00.226: E/AndroidRuntime(868): at java.lang.reflect.Method.invoke(Method.java:511)
08-06 10:18:00.226: E/AndroidRuntime(868): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-06 10:18:00.226: E/AndroidRuntime(868): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-06 10:18:00.226: E/AndroidRuntime(868): at dalvik.system.NativeStart.main(Native Method)
08-06 10:18:00.226: E/AndroidRuntime(868): Caused by: java.lang.ClassNotFoundException: com.example.myoverlays1.MyOverlays
08-06 10:18:00.226: E/AndroidRuntime(868): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
08-06 10:18:00.226: E/AndroidRuntime(868): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-06 10:18:00.226: E/AndroidRuntime(868): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-06 10:18:00.226: E/AndroidRuntime(868): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
08-06 10:18:00.226: E/AndroidRuntime(868): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
08-06 10:18:00.226: E/AndroidRuntime(868): ... 11 more
08-06 10:18:01.996: I/Process(868): Sending signal. PID: 868 SIG: 9
Upvotes: 0
Views: 404
Reputation: 1531
Have you added com.example.myoverlays1.MyOverlays
in your AndroidManifest.xml
?
Upvotes: 0
Reputation: 24476
If MyOverlays
is your own class file means, Did you properly declared the MyOverlays
in your AndroidManifest.xml
file. Like below -
<activity android:name=".MyOverlays"></activity>
Otherwise, if it is class file from any external .jar
file means, Did you import it properly,
Create a libs
folder in your project. And, copy the required .jar
file in there.
Import it properly using (project -> properties -> java build path -> Add jars/Add external jars -> select jar file)
Hope this helps you.
Edit
I hope that your MyOverlays
is a class file that is working for MapView
for this, you've to declare this class in your manifest file as -
<activity android:name="com.example.myoverlays1.MyOverlays"></activity>
and, check there your maps library declared or not
<uses-library android:name="com.google.android.maps" />
inside of your <application>
tag.
Upvotes: 3
Reputation: 5258
Please check all activities are declared in Android Manfiest.xml. It looks like MyOverlays class is not declared in AndroidManfiest.xml
Upvotes: 0
Reputation: 1094
you use external lib you give reference but you set tick in property of that project to resolve that error
or you use myoverlay in xml that not get reference
Upvotes: 0