我正在尝试Hello MapView Tutorial。当我在模拟器中启动程序时,我得到了大量错误(没有任何异常似乎与我的代码中的行有关)。模拟器窗口告诉程序“意外停止”。任何人都可以告诉我哪个是错误输出中的关键线?我需要改变什么?
05-02 15:04:57.195: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)
05-02 15:04:57.195: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)
05-02 15:04:57.195: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test' (No such file or directory)
05-02 15:04:57.195: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)
05-02 15:05:10.659: ERROR/MemoryHeapBase(51): error opening /dev/pmem: No such file or directory
05-02 15:05:10.659: ERROR/SurfaceFlinger(51): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
05-02 15:05:10.699: ERROR/libEGL(51): couldn't load <libhgl.so> library (Cannot load library: load_library[984]: Library 'libhgl.so' not found)
05-02 15:05:11.403: ERROR/libEGL(62): couldn't load <libhgl.so> library (Cannot load library: load_library[984]: Library 'libhgl.so' not found)
05-02 15:05:14.775: ERROR/BatteryService(51): Could not open '/sys/class/power_supply/usb/online'
05-02 15:05:14.775: ERROR/BatteryService(51): Could not open '/sys/class/power_supply/battery/batt_vol'
05-02 15:05:14.775: ERROR/BatteryService(51): Could not open '/sys/class/power_supply/battery/batt_temp'
05-02 15:05:15.148: ERROR/EventHub(51): could not get driver version for /dev/input/mouse0, Not a typewriter
05-02 15:05:15.148: ERROR/EventHub(51): could not get driver version for /dev/input/mice, Not a typewriter
05-02 15:05:15.282: ERROR/System(51): Failure starting core service
05-02 15:05:15.282: ERROR/System(51): java.lang.SecurityException
05-02 15:05:15.282: ERROR/System(51): at android.os.BinderProxy.transact(Native Method)
05-02 15:05:15.282: ERROR/System(51): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
05-02 15:05:15.282: ERROR/System(51): at android.os.ServiceManager.addService(ServiceManager.java:72)
05-02 15:05:15.282: ERROR/System(51): at com.android.server.ServerThread.run(SystemServer.java:162)
05-02 15:05:15.302: ERROR/AndroidRuntime(51): Crash logging skipped, no checkin service
05-02 15:05:17.012: ERROR/LockPatternKeyguardView(51): Failed to bind to GLS while checking for account
05-02 15:05:21.795: ERROR/ActivityThread(100): Failed to find provider info for com.google.settings
05-02 15:05:21.819: ERROR/ActivityThread(100): Failed to find provider info for com.google.settings
05-02 15:05:25.872: ERROR/ApplicationContext(51): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml
05-02 15:05:28.923: ERROR/vold(26): Cannot start volume '/sdcard' (volume is not bound)
05-02 15:05:26.879: ERROR/ActivityThread(97): Failed to find provider info for android.server.checkin
05-02 15:05:30.211: ERROR/ActivityThread(97): Failed to find provider info for android.server.checkin
05-02 15:05:30.430: ERROR/ActivityThread(97): Failed to find provider info for android.server.checkin
05-02 15:05:32.463: ERROR/MediaPlayerService(30): Couldn't open fd for content://settings/system/notification_sound
05-02 15:05:32.489: ERROR/MediaPlayer(51): Unable to to create media player
05-02 15:05:34.783: ERROR/ActivityThread(51): Failed to find provider info for com.google.settings
05-02 15:05:34.783: ERROR/ActivityThread(51): Failed to find provider info for com.google.settings
05-02 15:05:35.359: ERROR/AndroidRuntime(201): Uncaught handler: thread main exiting due to uncaught exception
05-02 15:05:35.395: ERROR/AndroidRuntime(201): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.diretto.client.smartphone.android/org.diretto.client.smartphone.android.ShowMap}: java.lang.ClassNotFoundException: org.diretto.client.smartphone.android.ShowMap in loader dalvik.system.PathClassLoader@4376af90
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2324)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread.access$2100(ActivityThread.java:116)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.os.Handler.dispatchMessage(Handler.java:99)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.os.Looper.loop(Looper.java:123)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread.main(ActivityThread.java:4203)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at java.lang.reflect.Method.invokeNative(Native Method)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at java.lang.reflect.Method.invoke(Method.java:521)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at dalvik.system.NativeStart.main(Native Method)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): Caused by: java.lang.ClassNotFoundException: org.diretto.client.smartphone.android.ShowMap in loader dalvik.system.PathClassLoader@4376af90
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.Instrumentation.newActivity(Instrumentation.java:1097)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): ... 11 more
05-02 15:05:35.527: ERROR/dalvikvm(201): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
答案 0 :(得分:2)
似乎没有例外 与我的代码中的行相关
最肯定的是:
05-02 15:05:35.395: ERROR/AndroidRuntime(201): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.diretto.client.smartphone.android/org.diretto.client.smartphone.android.ShowMap}: java.lang.ClassNotFoundException: org.diretto.client.smartphone.android.ShowMap in loader dalvik.system.PathClassLoader@4376af90
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2324)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread.access$2100(ActivityThread.java:116)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.os.Handler.dispatchMessage(Handler.java:99)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.os.Looper.loop(Looper.java:123)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread.main(ActivityThread.java:4203)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at java.lang.reflect.Method.invokeNative(Native Method)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at java.lang.reflect.Method.invoke(Method.java:521)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at dalvik.system.NativeStart.main(Native Method)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): Caused by: java.lang.ClassNotFoundException: org.diretto.client.smartphone.android.ShowMap in loader dalvik.system.PathClassLoader@4376af90
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.Instrumentation.newActivity(Instrumentation.java:1097)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)
05-02 15:05:35.395: ERROR/AndroidRuntime(201): ... 11 more
关键是:
05-02 15:05:35.395: ERROR/AndroidRuntime(201): Caused by: java.lang.ClassNotFoundException: org.diretto.client.smartphone.android.ShowMap in loader dalvik.system.PathClassLoader@4376af90
可以通过实现org.diretto.client.smartphone.android.ShowMap类或确保其超类存在来解决。
由于你正在玩地图,我猜你是在Android模拟器中尝试这个。您的模拟器AVD可能没有安装Google API,因此Android无法找到ShowMap
的某些与地图相关的超类(例如MapActivity
)。确保您的AVD不仅适用于Android 2.1(或其他),但其中包含Google API。