我想在 PhoneGap 项目中安装BarcodeScanner 插件。我已经阅读了存储库中的自述文件,它说必须使用 PlugMan 安装它,如下所示:
Install a plugin
----------------
$ plugman install --platform <platform> --project <directory> --plugin <plugin> [--variable NAME=VALUE]
Parameters:
- platform <platform>: One of android, ios, blackberry10, wp7 or wp8
- project <directory>: Path reference to a cordova-generated project of the platform you specify
- plugin <plugin>: One of a path reference to a local copy of a plugin, or a remote https: or git: URL pointing to a cordova plugin (optionally append #branch:subdir) or a plugin ID from http://plugins.cordova.io
- variable NAME=VALUE: Some plugins require install-time variables to be defined. These could be things like API keys/tokens or other app-specific variables.
当我从我的项目目录中运行以下命令时:
cordova plugin add com.phonegap.plugins.barcodescanner
我收到以下错误响应:
Fetching plugin "com.phonegap.plugins.barcodescanner" via plugin registry
Installing "com.phonegap.plugins.barcodescanner" for android
Error during processing of action! Attempting to revert...
Failed to install 'com.phonegap.plugins.barcodescanner':Error: Uh oh!
"/Users/Joel/Desktop/Sites/SampleProject/SampleProject/plugins/com.phonegap.plugins.barcodescanner/src/android/com.google.zxing.client.android.captureactivity.jar" not found!
at Object.module.exports.common.copyFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:20:40)
at Object.module.exports.common.copyNewFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:37:16)
at module.exports.source-file.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:42:20)
at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:47:25)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:553:20)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:303:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44
Error: Uh oh!
"/Users/Joel/Desktop/Sites/SampleProject/SampleProject/plugins/com.phonegap.plugins.barcodescanner/src/android/com.google.zxing.client.android.captureactivity.jar" not found!
at Object.module.exports.common.copyFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:20:40)
at Object.module.exports.common.copyNewFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:37:16)
at module.exports.source-file.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:42:20)
at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:47:25)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:553:20)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:303:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44
Joels-MacBook-Pro:UniSaver Joel$ cordova plugin add com.phonegap.plugins.barcodescanner
Fetching plugin "com.phonegap.plugins.barcodescanner" via plugin registry
Installing "com.phonegap.plugins.barcodescanner" for android
Error during processing of action! Attempting to revert...
Failed to install 'com.phonegap.plugins.barcodescanner':Error: Uh oh!
"/Users/Joel/Desktop/Sites/SampleProject/SampleProject/plugins/com.phonegap.plugins.barcodescanner/src/android/com.google.zxing.client.android.captureactivity.jar" not found!
at Object.module.exports.common.copyFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:20:40)
at Object.module.exports.common.copyNewFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:37:16)
at module.exports.source-file.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:42:20)
at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:47:25)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:553:20)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:303:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44
Error: Uh oh!
"/Users/Joel/Desktop/Sites/SampleProject/SampleProject/plugins/com.phonegap.plugins.barcodescanner/src/android/com.google.zxing.client.android.captureactivity.jar" not found!
at Object.module.exports.common.copyFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:20:40)
at Object.module.exports.common.copyNewFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:37:16)
at module.exports.source-file.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:42:20)
at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:47:25)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:553:20)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:303:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44
我究竟做错了什么?我应该将文件复制到项目目录中的某个目录吗?或者在使用plugman之前我应该运行任何其他命令吗?