Phonegap 3.3.0无法添加任何插件

时间:2014-01-21 17:05:10

标签: ios cordova phonegap-plugins cordova-3

我正在尝试将barcodescanner插件添加到Phonegap 3.3.0项目中。

重现的步骤:

$ cordova create app de.app.name "app-name"
$ cd app
$ cordova platform add ios
$ cordova plugin add com.phonegap.plugins.barcodescanner

Fetching plugin from "com.phonegap.plugins.barcodescanner"...
Starting installation of "com.phonegap.plugins.barcodescanner" for ios
Error during processing of action! Attempting to revert...

/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error: Uh oh!
cannot find "/path/app/plugins/com.phonegap.plugins.barcodescanner/src/ios/CDVBarcodeScanner.mm" ios <source-file>
    at module.exports.source-file.install (/usr/local/lib/node_modules/cordova/node_modules/plugman/src/platforms/ios.js:44:48)
    at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/plugman/src/util/action-stack.js:46:25)
    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/plugman/src/install.js:380:20)
    at /usr/local/lib/node_modules/cordova/node_modules/plugman/src/install.js:331:20
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/plugman/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/plugman/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/plugman/node_modules/q/q.js:760:13)
    at /usr/local/lib/node_modules/cordova/node_modules/plugman/node_modules/q/q.js:574:44
    at flush (/usr/local/lib/node_modules/cordova/node_modules/plugman/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:415:13)

如果我使用github链接,我会得到同样的错误:

$ cordova plugin add https://github.com/phonegap-build/BarcodeScanner
Fetching plugin from "https://github.com/phonegap-build/BarcodeScanner"...
Starting installation of "com.phonegap.plugins.barcodescanner" for ios
Preparing ios project

/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
SyntaxError: Unexpected token

此外,我对插件的原始版本也一样:

$ cordova plugin add https://github.com/wildabeast/BarcodeScanner

我找到了一个关于problem in phonegap 3.0.0的帖子,但https://github.com/jonathannaguin/BarcodeScanner仍然给了我同样的错误。

我猜导入部分是cannot find "/path/app/plugins/com.phonegap.plugins.barcodescanner/src/ios/CDVBarcodeScanner.mm" ios。有什么想法我可以深入研究并使其发挥作用吗?

更新

org.apache.cordova.console我遇到了同样的问题。如果我使用phonegap local plugin add ...

我注意到www/config.xmlplatforms/ios/www/config.xml已被破坏。文件末尾有一些可以删除的二进制空格。可能有messed up with phonegap itself

1 个答案:

答案 0 :(得分:1)

问题是由我所在的目录造成的。如果我执行cd ~并运行相同的命令,它就会起作用!

我在\Volumes/www,在smbfs上安装了 samba共享