问题
I am trying to run demo from https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/master/demo both locally and online at https://play.nativescript.org/?template=play-tsc&id=CB7XFu&v=2 but no luck. On the playground I have added the plugin.
I noticed there is a similar question here How to use BarcodeScanner plugin from NativeScript but seems it's 3 years before and the plugin changed a lot after that.
Can anyone try the playground and tell which line I got wrong? I strictly followed the demo in github. The error message is Can't find variable: QRCodeReaderDelegate
回答1:
With Playground (online) Or Preview command (locally), You can not use plugin those require native dependency such as Barcode Scanner.
You will have to build the project using tns [run|build]
commands locally, only then the native dependencies will be installed and you will be able to run them successfully.
来源:https://stackoverflow.com/questions/57368317/how-to-deploy-nativescript-barcodescanner-in-typescript