条码扫描方法 - 使用nativescript-barcodescanner的原生脚本。

问题描述 投票:0回答:1

我正在用nativescript为android设备开发一个应用,尝试使用插件中的扫描方法,但没有成功,不幸的是这是nativescript唯一的条码扫描插件,我从这个游乐场中获取了代码。https:/play.nativescript.org?template=play-ng&id=03Ge8E&v=5。

抛出的错误。

System.err: An uncaught Exception occurred on "main" thread.
System.err: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=234, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {org.nativescript.blankng/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onRequestPermissionsResult failed
System.err: TypeError: Cannot read property 'client' of undefined
System.err:
System.err: StackTrace:
System.err: java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=234, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {org.nativescript.blankng/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onRequestPermissionsResult failed
System.err: TypeError: Cannot read property 'client' of undefined
System.err:     at android.app.ActivityThread.deliverResults(ActivityThread.java:4605)
System.err:     at android.app.ActivityThread.handleSendResult(ActivityThread.java:4647)
System.err:     at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
System.err:     at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
System.err:     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:106)
System.err:     at android.os.Looper.loop(Looper.java:214)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:7045)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
System.err: Caused by: com.tns.NativeScriptException: Calling js method onRequestPermissionsResult failed
System.err: TypeError: Cannot read property 'client' of undefined
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1160)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1138)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1134)
System.err:     at com.tns.NativeScriptActivity.onRequestPermissionsResult(NativeScriptActivity.java:72)
System.err:     at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7941)
System.err:     at android.app.Activity.dispatchActivityResult(Activity.java:7763)
System.err:     at android.app.ActivityThread.deliverResults(ActivityThread.java:4598)
System.err:     ... 11 more
android npm nativescript nativescript-angular
1个回答
0
投票

我修好了! 我只是删除了所有的东西,并重新创建项目

© www.soinside.com 2019 - 2024. All rights reserved.