Javascript 找不到phonegap/cordova模块
我在plugin.xml中安装了一个插件Javascript 找不到phonegap/cordova模块,javascript,android,cordova,bluetooth,Javascript,Android,Cordova,Bluetooth,我在plugin.xml中安装了一个插件 <js-module src="www/org.bcsphere/bc.js" name="bcjs"> <merges target="BC" /> </js-module> 构建完成后,我可以在c:\myapp\platforms\android\assets\www\plugins\org.bcsphere.bluetooth\www\org.bcsphere\bc.js中看到包装在 cordova.d
<js-module src="www/org.bcsphere/bc.js" name="bcjs">
<merges target="BC" />
</js-module>
构建完成后,我可以在c:\myapp\platforms\android\assets\www\plugins\org.bcsphere.bluetooth\www\org.bcsphere\bc.js中看到包装在
cordova.define("org.bcsphere.bluetooth.bcjs", function(require, exports, module) {
...
}
我想现在我可以在我的app/js/index.js中完成
onDeviceReady: function() {
try{
var BC = window.BC = cordova.require("org.bcsphere.bluetooth.bcjs");
}
catch(err) {
console.log(err);
}
app.receivedEvent('deviceready');
}
但我得到了:
[phonegap] [console.log] module org.bcsphere.bluetooth.bcjs not found
为什么找不到模块
onDeviceReady: function() {
try{
var BC = window.BC = cordova.require("org.bcsphere.bluetooth.bcjs");
}
catch(err) {
console.log(err);
}
app.receivedEvent('deviceready');
}
[phonegap] [console.log] module org.bcsphere.bluetooth.bcjs not found