为什么我在连接重力传感器时,总是出现以下错误信息: Failed to find provider info for org.openintents.sensorsimulator04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542): java.lang.NullPointerException
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at org.openintents.sensorsimulator.db.SensorSimulatorConvenience.getPreference
(SensorSimulatorConvenience.java:116)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at org.openintents.sensorsimulator.hardware.SensorSimulatorClient.connect(SensorSimulatorClient.java:84)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at org.openintents.sensorsimulator.hardware.SensorManagerSimulator.connectSimulator(SensorManagerSimulator.java:188)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at com.android.DriftBall.onCreate(DriftBall.java:84)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.os.Looper.loop(Looper.java:123)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.ActivityThread.main(ActivityThread.java:4627)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at java.lang.reflect.Method.invokeNative(Native Method)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at java.lang.reflect.Method.invoke(Method.java:521)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at dalvik.system.NativeStart.main(Native Method)04-07 11:38:36.031: ERROR/AndroidRuntime(542): Caused by: java.lang.NumberFormatException: unable to parse 'Preferences table corrupt!' as integer

解决方案 »

  1.   

    java.lang.NullPointerException空指针了哥哥 
      

  2.   

    虽然java不存在指针,翻译过来的意思就是没有找到相关对象
    在SensorSimulatorConvenience.java中 org.openintents.sensorsimulator.db.SensorSimulatorConvenience.getPreference
    就是getPreference  get不到东西
      

  3.   

    NullPointerException错误和
    NumberFormatException异常。
      

  4.   

    之前遇到和楼主一样的问题,纠结2天了。终于回到下那个工具的网站发现问题所在:SensorSimulator那个工具没有安装在虚拟机上!(无力吐槽)安装好了才能和PC端的那个JAR程序连接。刚刚重新在DOS下安装,结果adb命令又有问题,不过有人解决了,直接把错误拿来百度就行,自学Android的人伤不起啊~
      

  5.   

    在DOS下安装,最好安装在哪个文件夹下呢?
      

  6.   

    04-07 11:38:36.031: ERROR/AndroidRuntime(542): Caused by: java.lang.NumberFormatException: unable to parse ='' as integer我的报这样的错误又是为什么呢,,
      

  7.   

    问一下楼主这个sensorsimulator如何使用啊。。怎样判断重力传感器呢,,
      

  8.   

    在真机上跑的代码和在模拟器上的有区别吗?我在真机上跑为什么获得不了传感器?
    sensorManager.connectSimulator();报错
    08-08 16:42:35.352: E/CMarlinMediator(1483): [13] ERROR : const sony::drm::CTime sony::drm::CMarlinMediator::getTrustedTime() calling tt_GetTrustedTime. return code 588120065 
    08-08 16:42:37.554: E/PushConnection(6035): receive err,errno:0
    08-08 16:42:40.697: E/ActivityThread(7382): Failed to find provider info for org.openintents.sensorsimulator
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382): insert into table 'contains' failed
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382): java.lang.NullPointerException
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at org.openintents.sensorsimulator.db.SensorSimulatorConvenience.getPreference(SensorSimulatorConvenience.java:129)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at org.openintents.sensorsimulator.hardware.SensorSimulatorClient.connect(SensorSimulatorClient.java:108)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at org.openintents.sensorsimulator.hardware.SensorManagerSimulator.connectSimulator(SensorManagerSimulator.java:220)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at com.zgct.Main.onCreate(Main.java:30)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at android.app.ActivityThread.access$1500(ActivityThread.java:121)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at android.os.Handler.dispatchMessage(Handler.java:99)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at android.os.Looper.loop(Looper.java:138)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at android.app.ActivityThread.main(ActivityThread.java:3701)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at java.lang.reflect.Method.invokeNative(Native Method)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at java.lang.reflect.Method.invoke(Method.java:507)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
    08-08 16:42:40.707: E/SensorSimulatorConvenience(7382):  at dalvik.system.NativeStart.main(Native Method)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382): insert into table 'contains' failed
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382): java.lang.NullPointerException
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at org.openintents.sensorsimulator.db.SensorSimulatorConvenience.getPreference(SensorSimulatorConvenience.java:129)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at org.openintents.sensorsimulator.hardware.SensorSimulatorClient.connect(SensorSimulatorClient.java:110)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at org.openintents.sensorsimulator.hardware.SensorManagerSimulator.connectSimulator(SensorManagerSimulator.java:220)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at com.zgct.Main.onCreate(Main.java:30)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at android.app.ActivityThread.access$1500(ActivityThread.java:121)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at android.os.Handler.dispatchMessage(Handler.java:99)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at android.os.Looper.loop(Looper.java:138)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at android.app.ActivityThread.main(ActivityThread.java:3701)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at java.lang.reflect.Method.invokeNative(Native Method)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at java.lang.reflect.Method.invoke(Method.java:507)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
    08-08 16:42:40.717: E/SensorSimulatorConvenience(7382):  at dalvik.system.NativeStart.main(Native Method)
    08-08 16:42:40.717: E/ActivityThread(7382): Failed to find provider info for org.openintents.sensorsimulator
    08-08 16:42:40.737: E/AndroidRuntime(7382): FATAL EXCEPTION: main
    08-08 16:42:40.737: E/AndroidRuntime(7382): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.zgct/com.zgct.Main}: java.lang.NumberFormatException: unable to parse 'Preferences table corrupt!' as integer
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at android.app.ActivityThread.access$1500(ActivityThread.java:121)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at android.os.Handler.dispatchMessage(Handler.java:99)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at android.os.Looper.loop(Looper.java:138)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at android.app.ActivityThread.main(ActivityThread.java:3701)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at java.lang.reflect.Method.invokeNative(Native Method)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at java.lang.reflect.Method.invoke(Method.java:507)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at dalvik.system.NativeStart.main(Native Method)
    08-08 16:42:40.737: E/AndroidRuntime(7382): Caused by: java.lang.NumberFormatException: unable to parse 'Preferences table corrupt!' as integer
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at java.lang.Integer.parse(Integer.java:383)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at java.lang.Integer.parseInt(Integer.java:372)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at java.lang.Integer.parseInt(Integer.java:332)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at org.openintents.sensorsimulator.hardware.SensorSimulatorClient.connect(SensorSimulatorClient.java:116)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at org.openintents.sensorsimulator.hardware.SensorManagerSimulator.connectSimulator(SensorManagerSimulator.java:220)
    08-08 16:42:40.737: E/AndroidRuntime(7382):  at com.zgct.Main.onCreate(Main.java:30)