Android中的离子条形码扫描过程崩溃

时间:2018-11-21 04:58:16

标签: java android cordova ionic-framework barcode

我使用了cordova插件https://ionicframework.com/docs/native/barcode-scanner/

我需要扫描多个条形码的地方,但是经过一次或更多次扫描后,Android App崩溃了。在IOS设备上可以正常工作。

这是崩溃日志:

  

11-20 18:45:39.923 30115-30115 / com.xyz.optilockdev   E / BoostFramework:BoostFramework():Exception_1 =   java.lang.ClassNotFoundException:找不到类   路径上的“ com.qualcomm.qti.Performance”:   DexPathList [[],nativeLibraryDirectories = [/ system / lib,/ vendor / lib]]   11-20 18:45:53.258 30115-30115 / com.xyx.optilockdev   E / ViewRootImpl @ 940705f [MainActivity]:ViewRootImpl#2 Surface不是   有效。 11-20 18:46:06.928 30115-30188 / com.xyz.optilockdev   E / PluginManager:插件未捕获的异常
  java.lang.IllegalArgumentException:服务未注册:   de.appplant.cordova.plugin.background.BackgroundMode$1@7c72892       在android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1352)       在android.app.ContextImpl.unbindService(ContextImpl.java:1553)       在android.content.ContextWrapper.unbindService(ContextWrapper.java:723)       在de.appplant.cordova.plugin.background.BackgroundMode.stopService(BackgroundMode.java:256)       在de.appplant.cordova.plugin.background.BackgroundMode.disableMode(BackgroundMode.java:166)       在de.appplant.cordova.plugin.background.BackgroundMode.execute(BackgroundMode.java:107)       在org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)       在org.apache.cordova.PluginManager.exec(PluginManager.java:132)       在org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)       在org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)       在android.os.MessageQueue.nativePollOnce(本地方法)       在android.os.MessageQueue.next(MessageQueue.java:323)       在android.os.Looper.loop(Looper.java:136)       在android.os.HandlerThread.run(HandlerThread.java:61)11-20 18:46:45.624 30115-30115 / com.xyz.optilockdev E / AndroidRuntime:FATAL   例外:主要程序:com.xyx.optilockdev,PID:30115
  java.lang.RuntimeException:无法恢复活动   {com.xyz.optilockdev / com.xyz.optilockdev.MainActivity}:   java.lang.IllegalArgumentException:服务未注册:   de.appplant.cordova.plugin.background.BackgroundMode$1@7c72892       在android.app.ActivityThread.performResumeActivity(ActivityThread.java:3844)       在android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3885)       在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1692)       在android.os.Handler.dispatchMessage(Handler.java:102)       在android.os.Looper.loop(Looper.java:154)       在android.app.ActivityThread.main(ActivityThread.java:6776)       在java.lang.reflect.Method.invoke(本机方法)       在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1518)       com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)的原因:java.lang.IllegalArgumentException:服务未注册:   de.appplant.cordova.plugin.background.BackgroundMode$1@7c72892       在android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1352)       在android.app.ContextImpl.unbindService(ContextImpl.java:1553)       在android.content.ContextWrapper.unbindService(ContextWrapper.java:723)       在de.appplant.cordova.plugin.background.BackgroundMode.stopService(BackgroundMode.java:256)       在de.appplant.cordova.plugin.background.BackgroundMode.onResume(BackgroundMode.java:139)       在org.apache.cordova.PluginManager.onResume(PluginManager.java:264)       在org.apache.cordova.CordovaWebViewImpl.handleResume(CordovaWebViewImpl.java:450)       在org.apache.cordova.CordovaActivity.onResume(CordovaActivity.java:275)       在android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1277)       在android.app.Activity.performResume(Activity.java:7115)       在android.app.ActivityThread.performResumeActivity(ActivityThread.java:3821)       在android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3885)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:67

1 个答案:

答案 0 :(得分:4)

按照OP提到的错误跟踪,这是后台插件而不是条形码扫描插件的问题。

根据issue link,崩溃问题仍在后台插件中打开,目前尚未解决。

现在删除后台插件应该可以解决条形码扫描时的崩溃问题。