【问题标题】:cordova require a plugin科尔多瓦需要一个插件
【发布时间】:2015-07-12 18:59:18
【问题描述】:

我将此插件https://github.com/bcsphere/bluetooth 添加到我的应用程序中:

phonegap plugin add https://github.com/bcsphere/bluetooth.git 

我正在关注他们的教程: https://github.com/bcsphere/tutorial/blob/master/chapter01/js/index.js#L17

据我所知,插件的 www 文件夹将与我的应用程序的 www 文件夹合并?那我该如何正确导入模块,因为

var BC = window.BC = cordova.require("org.bcsphere.bcjs");

导致以下错误:

file:///data/data/com.adobe.phonegap.app/files/files/phonegapdevapp/www/cordova.js:59

未找到未捕获的模块 org.bcsphere.bcjs

如果您查看插件的 www 文件夹https://github.com/bcsphere/bluetooth/tree/master/www,您可以看到所有可用的模块。我需要主:https://github.com/bcsphere/bluetooth/blob/master/www/org.bcsphere/bc.js

编辑

我也试过org.bcsphere.bc.jsorg.bcsphere.bcorg.bcsphere/bc.js

【问题讨论】:

    标签: cordova phonegap-plugins phonegap-build


    【解决方案1】:

    所以我不完全确定,因为我无法尝试,但逻辑上认为它会是

    org.bcsphere/bc.js
    

    对吗?

    【讨论】:

    • 是的,但它会产生相同的错误:“未找到未捕获的模块 org.bcsphere/bc.js”
    猜你喜欢
    • 1970-01-01
    • 2015-10-13
    • 1970-01-01
    • 1970-01-01
    • 2016-08-30
    • 2015-05-19
    • 1970-01-01
    • 1970-01-01
    • 2015-09-08
    相关资源
    最近更新 更多