scandit android cordova错误

时间:2014-06-30 20:02:40

标签: android cordova

我试图添加scandit android 4.0.1但是我收到了以下错误

当我开始调用android调用函数

对同一个问题或者只是我做过任何一件好事吗?

    06-30 21:58:34.434: E/AndroidRuntime(13096): FATAL EXCEPTION: main
06-30 21:58:34.434: E/AndroidRuntime(13096): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.test/com.mirasense.scanditsdk.plugin.ScanditSDKActivity}: java.lang.NullPointerException
06-30 21:58:34.434: E/AndroidRuntime(13096):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at android.app.ActivityThread.access$700(ActivityThread.java:159)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at android.os.Handler.dispatchMessage(Handler.java:99)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at android.os.Looper.loop(Looper.java:176)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at android.app.ActivityThread.main(ActivityThread.java:5419)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at java.lang.reflect.Method.invokeNative(Native Method)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at java.lang.reflect.Method.invoke(Method.java:525)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at dalvik.system.NativeStart.main(Native Method)
06-30 21:58:34.434: E/AndroidRuntime(13096): Caused by: java.lang.NullPointerException
06-30 21:58:34.434: E/AndroidRuntime(13096):    at com.mirasense.scanditsdk.plugin.ScanditSDKActivity.initializeAndStartBarcodeRecognition(ScanditSDKActivity.java:218)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at com.mirasense.scanditsdk.plugin.ScanditSDKActivity.onCreate(ScanditSDKActivity.java:50)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at android.app.Activity.performCreate(Activity.java:5372)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
06-30 21:58:34.434: E/AndroidRuntime(13096):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)
06-30 21:58:34.434: E/AndroidRuntime(13096):    ... 11 more

1 个答案:

答案 0 :(得分:1)

看起来你为“cameraSwitchVisibility”设置了一个奇数值,就像bool或整数而不是字符串。正如您在文档(http://docs.scandit.com/interface_cordova_plugin.html)中看到的那样,唯一允许的值是“never”,“tablet”和“always”。

如果这不能解决问题,请粘贴您在应用中使用的cordova.exec电话。