【发布时间】:2017-05-10 12:27:51
【问题描述】:
我正在使用 Phonegap,我想使用这个 m 插件:https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer
当我尝试使用这个插件时,不幸的是控制台打印了这个信息:
Uncaught ReferenceError: BTPrinter is not defined
但如果我使用 cmd 并检查了插件: ...转到应用文件夹并输入 phonegap plugin list
我明白了:cordova-plugin-bluetooth-printer 0.0.1-dev "BluetoothPrinter"
你知道哪里有问题吗?
confix.xml:
`<gap:plugin name="cordova-plugin-bluetooth-printer" />`
谢谢!
【问题讨论】:
-
很大程度上取决于构建的设置方式。很可能任何进程都没有将插件 src 复制到正确的位置,或者您实际运行的应用程序没有在库存在的任何位置查找。
-
我使用了Phonegap桌面应用程序(只需点击make new project)。
-
App 文件夹包含以下子文件夹:.cordova、hook、platforms、plugins(包含蓝牙打印机插件)、red、www、confix.xml
-
你添加了android/ios平台吗?
-
只需尝试删除当前平台并添加新平台(android/ios),然后重新安装插件。