2

Its the same program that I asked about here. I fixed that problem, but now when I launch it, it crashes, and get:

W/dalvikvm(  316): Unable to resolve superclass of Lcom/wingdom/convention/Map; (12)
W/dalvikvm(  316): Link of class 'Lcom/wingdom/convention/Map;' failed
E/dalvikvm(  316): Could not find class 'com.wingdom.convention.Map', referenced from method com.wingdom.convention.TabWidget.onCreate
W/dalvikvm(  316): VFY: unable to resolve const-class 13 (Lcom/wingdom/convention/Map;) in Lcom/wingdom/convention/TabWidget;
D/dalvikvm(  316): VFY: replacing opcode 0x1c at 0x003a
D/dalvikvm(  316): VFY: dead code 0x003c-005e in Lcom/wingdom/convention/TabWidget;.onCreate (Landroid/os/Bundle;)V
D/AndroidRuntime(  316): Shutting down VM
W/dalvikvm(  316): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime(  316): FATAL EXCEPTION: main
E/AndroidRuntime(  316): java.lang.NoClassDefFoundError: com.wingdom.convention.Map
E/AndroidRuntime(  316):    at com.wingdom.convention.TabWidget.onCreate(TabWidget.java:29)
E/AndroidRuntime(  316):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(  316):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime(  316):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime(  316):    at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime(  316):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime(  316):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  316):    at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  316):    at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(  316):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  316):    at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  316):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(  316):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime(  316):    at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(   59):   Force finishing activity com.wingdom.convention/.TabWidget

The app has 3 activity classes, TabWidget, Schedule, and Map (Map is actually a MapActivity, but its blank right now, want the app to run first). TabWidget is almost exactly the HelloTabWidget learning example given at the android developer site. Schedule is just a list of text. If you need to see any code to help fix it, just ask. Thanks in advance!

Community
  • 1
  • 1
Wingdom
  • 439
  • 2
  • 10
  • 23

2 Answers2

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

Make sure to add this as a child of your application in the manifest. This will stop the crash.

You'll need to add the Internet permission as a child of your manifest as well.

<uses-permission android:name="android.permission.INTERNET" />
Joe
  • 4,801
  • 2
  • 16
  • 8
1

To use MapActivity, you need to setup a virtual device that includes the Google APIs. Setting up just a vanilla Android virtual device isn't good enough.

Look here for more information:

mharper
  • 3,212
  • 1
  • 23
  • 23
  • I am using a virtual device that is Google API, Platform 2.2, Level 8. I read the intro on using a MapActivity. It crashes on the Virtual Device, and my Droid Incredible, with roughly the same error log. – Wingdom Apr 20 '11 at 23:43
  • Weird. I was basing my answer on the first line of errors: Unable to resolve superclass of Lcom/wingdom/convention/Map; (12) – mharper Apr 20 '11 at 23:52
  • In which case I refer you back to duffymo: 90% of all Java problems are CLASSPATH-related. – mharper Apr 20 '11 at 23:59
  • what do you make of: E/AndroidRuntime( 316): FATAL EXCEPTION: main E/AndroidRuntime( 316): java.lang.NoClassDefFoundError: com.wingdom.convention.Map – Wingdom Apr 21 '11 at 00:05
  • It can find the class just fine...the issue is that the superclass map library needs to be defined in the manifest – Joe Apr 21 '11 at 00:42