首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

AndroidRuntime(220): Caused by: java.lang.NullPointerException

2011-11-10 
angroid中出现以下问题,什么原因?08-01 09:10:25.171: ERROR/vold(27): Error opening switch name path

angroid中出现以下问题,什么原因?
08-01 09:10:25.171: ERROR/vold(27): Error opening switch name path '/sys/class/switch/test' (No such file or directory)
08-01 09:10:25.171: ERROR/vold(27): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)
08-01 09:10:25.171: ERROR/vold(27): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)
08-01 09:10:25.171: ERROR/vold(27): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)
08-01 09:10:35.502: ERROR/BatteryService(52): usbOnlinePath not found
08-01 09:10:35.502: ERROR/BatteryService(52): batteryVoltagePath not found
08-01 09:10:35.502: ERROR/BatteryService(52): batteryTemperaturePath not found
08-01 09:10:35.522: ERROR/SurfaceFlinger(52): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
08-01 09:10:38.921: ERROR/EventHub(52): could not get driver version for /dev/input/mouse0, Not a typewriter
08-01 09:10:38.921: ERROR/EventHub(52): could not get driver version for /dev/input/mice, Not a typewriter
08-01 09:10:39.131: ERROR/System(52): Failure starting core service
08-01 09:10:39.131: ERROR/System(52): java.lang.SecurityException
08-01 09:10:39.131: ERROR/System(52): at android.os.BinderProxy.transact(Native Method)
08-01 09:10:39.131: ERROR/System(52): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
08-01 09:10:39.131: ERROR/System(52): at android.os.ServiceManager.addService(ServiceManager.java:72)
08-01 09:10:39.131: ERROR/System(52): at com.android.server.ServerThread.run(SystemServer.java:176)
08-01 09:10:39.131: ERROR/AndroidRuntime(52): Crash logging skipped, no checkin service
08-01 09:10:45.905: ERROR/ActivityThread(93): Failed to find provider info for android.server.checkin
08-01 09:10:47.001: ERROR/ActivityThread(93): Failed to find provider info for android.server.checkin
08-01 09:10:47.101: ERROR/ActivityThread(93): Failed to find provider info for android.server.checkin
08-01 09:10:49.741: ERROR/MediaPlayerService(31): Couldn't open fd for content://settings/system/notification_sound
08-01 09:10:49.741: ERROR/MediaPlayer(52): Unable to to create media player
08-01 09:10:54.871: ERROR/AndroidRuntime(124): ERROR: thread attach failed
08-01 09:10:59.001: ERROR/AndroidRuntime(179): ERROR: thread attach failed
08-01 09:10:59.980: ERROR/AndroidRuntime(220): Uncaught handler: thread main exiting due to uncaught exception
08-01 09:10:59.991: ERROR/AndroidRuntime(220): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.testBlueTooth/com.testBlueTooth.testBlueTooth}: java.lang.NullPointerException
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at android.os.Handler.dispatchMessage(Handler.java:99)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at android.os.Looper.loop(Looper.java:123)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at android.app.ActivityThread.main(ActivityThread.java:4363)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at java.lang.reflect.Method.invokeNative(Native Method)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at java.lang.reflect.Method.invoke(Method.java:521)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)


08-01 09:10:59.991: ERROR/AndroidRuntime(220): at dalvik.system.NativeStart.main(Native Method)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): Caused by: java.lang.NullPointerException
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at com.testBlueTooth.testBlueTooth.onCreate(testBlueTooth.java:61)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
08-01 09:10:59.991: ERROR/AndroidRuntime(220): ... 11 more
08-01 09:11:00.031: ERROR/dalvikvm(220): Unable to open stack trace file '/data/anr/traces.txt': Permission denied


[解决办法]
不是说目录没找到么,你仔细看看目录的路径
[解决办法]

提供两个途径,请LZ试一下:

1) 请检查activities是否全部注册。

2) Failure starting core service
这个应该不是应用程序自身的问题。
google了一下,是模拟器环境出问题了。
根据其他log来看,估计是环境变量被破坏。
国外的大侠们建议重做一个模拟器。

热点排行