问题
I am trying to add barcodescanner plugin to an Phonegap 3.3.0 project.
Steps to reproduce:
$ 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)
If I use the github link I get the same error in short:
$ 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
Also I get the same for the original version of the plugin:
$ cordova plugin add https://github.com/wildabeast/BarcodeScanner
I found a thread about a problem in phonegap 3.0.0 but https://github.com/jonathannaguin/BarcodeScanner
still gives me the same error.
I guess the importen part is cannot find "/path/app/plugins/com.phonegap.plugins.barcodescanner/src/ios/CDVBarcodeScanner.mm" ios
. Any thoughts how I can dig deeper into this and make it work?
Update
I got the same problem with org.apache.cordova.console
. Also if I use phonegap local plugin add ...
.
I notice that www/config.xml
and platforms/ios/www/config.xml
are broken. There is some binary empty space at the end of the file that can be removed. There might be something messed up with phonegap itself.
回答1:
Problem is caused by the directory I am in. If I do cd ~
and run the same command it just works!
I was in \Volumes/www
with is a samba share mounted over smbfs.
来源:https://stackoverflow.com/questions/21264579/phonegap-3-3-0-cannot-add-any-plugin