你见过这个例外: 我正在尝试为我的应用程序制作卫星地图视图。但是,当在异常抛出之后调用Satellite Map Activity的启动活动时,没有成功:
12-27 12:08:34.895: INFO/ActivityManager(591): Starting activity: Intent { comp={com.mydomain.ca/com.mydomain.ca.SecondActivity} (has extras) }
12-27 12:08:35.233: WARN/dalvikvm(2845): Unable to resolve superclass of Lcom/mydomain/ca/SatelliteMapActivity; (61)
12-27 12:08:35.245: WARN/dalvikvm(2845): Link of class 'Lcom/mydomain/ca/SatelliteMapActivity;' failed
12-27 12:08:35.297: ERROR/dalvikvm(2845): Could not find class 'com.mydomain.ca.SatelliteMapActivity', referenced from method com.mydomain.ca.SecondActivity.startMapActivity
12-27 12:08:35.317: WARN/dalvikvm(2845): VFY: unable to resolve const-class 172 (Lcom/mydomain/ca/SatelliteMapActivity;) in Lcom/mydomain/ca/SecondActivity;
12-27 12:08:35.317: WARN/dalvikvm(2845): VFY: rejecting opcode 0x1c at 0x0005
12-27 12:08:35.344: WARN/dalvikvm(2845): VFY: rejected Lcom/mydomain/ca/SecondActivity;.startMapActivity ()V
12-27 12:08:35.344: WARN/dalvikvm(2845): Verifier rejected class Lcom/mydomain/ca/SecondActivity;
12-27 12:08:35.344: WARN/dalvikvm(2845): Class init failed in newInstance call (Lcom/mydomain/ca/SecondActivity;)
12-27 12:08:35.355: DEBUG/AndroidRuntime(2845): Shutting down VM
12-27 12:08:35.355: WARN/dalvikvm(2845): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
12-27 12:08:35.355: ERROR/AndroidRuntime(2845): Uncaught handler: thread main exiting due to uncaught exception
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): java.lang.VerifyError: com.mydomain.ca.SecondActivity
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at java.lang.Class.newInstanceImpl(Native Method)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at java.lang.Class.newInstance(Class.java:1472)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at android.app.Instrumentation.newActivity(Instrumentation.java:1097)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2186)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at android.app.ActivityThread.access$1800(ActivityThread.java:112)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at android.os.Handler.dispatchMessage(Handler.java:99)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at android.os.Looper.loop(Looper.java:123)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at android.app.ActivityThread.main(ActivityThread.java:3948)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at java.lang.reflect.Method.invokeNative(Native Method)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at java.lang.reflect.Method.invoke(Method.java:521)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
12-27 12:08:35.417: ERROR/AndroidRuntime(2845): at dalvik.system.NativeStart.main(Native Method)
这里有什么问题?
答案 0 :(得分:5)
哦,我找到了解决方案: http://code.google.com/android/add-ons/google-apis/mapkey.html
我没有设置这个:
<uses-library android:name="com.google.android.maps" />
在Manifest.xml上