gpt4 book ai didi

java - Android "application stopped unexpectedly"- google Hello MapView 教程

转载 作者:行者123 更新时间:2023-12-02 08:33:06 25 4
gpt4 key购买 nike

我正在尝试 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

最佳答案

none of the exceptions seems to be related with lines in my code

最肯定的是:

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 类或确保其父类(super class)存在来解决。

既然你正在玩 map ,我猜你正在 Android 模拟器中尝试这个。您的模拟器 AVD 可能没有安装 Google API,因此 Android 无法找到 ShowMap 的某些与 map 相关的父类(super class)(例如 MapActivity)。确保您的 AVD 不仅适用于 Android 2.1(或其他版本),而且还包含 Google API。

关于java - Android "application stopped unexpectedly"- google Hello MapView 教程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2753566/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com