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.
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.
Related
I'm trying to install PushWoosh, but I don't understand the first instruction here:
https://www.pushwoosh.com/programming-push-notification/ios/ios-additional-platforms/push-notification-sdk-integration-for-phonegap/
Install the Plugin source code for Phonegap push notifications into your app by running the following command in the command line:
phonegap plugin add
https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin.git
I tried that (copy and pasted it into terminal) and it gave me an error: [error] project directory could not be found
if you are using cordova, just use this other command (as with other cordova plugins):
cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin.git
I'm following the documentation trying to create a Cordova app for iOS. I'm using version 3.3 on OSX Maverick and here's what I did:
cordova create hello com.example.hello HelloWorld
cd hello
cordova platform add ios
cordova plugin add org.apache.cordova.device
at this point, cordova complained about missing xcode project:
Fetching plugin from "org.apache.cordova.device"...
Starting installation of "org.apache.cordova.device" for ios
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: does not appear to be an xcode project (no xcode project file)
at Object.module.exports.parseProjectFile (/usr/local/lib/node_modules/cordova/node_modules/plugman/src/platforms/ios.js:143:19)
at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/plugman/src/util/action-stack.js:34:49)
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/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
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
I'm wondering what I did wrong and how to resolve this problem?
I've figured it out. There are special characters in the path ([]), which may have caused trouble with file searching in nodejs. The error went away when the folder is moved to a location without such characters.
We're on PhoneGap 3.2, but the command to list plugins is generating an error:
w prompt$ phonegap local plugin list
[error] undefined
We're building for iOS. We have successfully installed several plugins, which are verified by looking at the plugins folder.
Did the command syntax change in 3.2, or is this a bug?
This was an issue that has just recently been fixed (About an hour from the posting of this answer).
Google Groups Discussion
To correct it just do the following
$ npm install -g phonegap
I am using Phonegap 3.0 for my latest project. I tried to add the native sqlite database plugin to prepopulate data from an existing database. The issue is i could install the plugin through commandline . It showed the following error:
#phonegap local plugin add https://github.com/jarlehansen/PhoneGap-SQLitePlugin-iOS.git
adding the plugin:
https://github.com/jarlehansen/PhoneGap-SQLitePlugin-iOS.git
fs.js:427 return binding.open(pathModule._makeLong(path),
stringToFlags(flags), mode);
^ Error: ENOENT, no such file or directory '/var/folders/7j/1qkbsztx3_bgtslq3pnnr9jc0000gn/T/plugman-tmp1383202788796/plugin.xml'
at Object.fs.openSync (fs.js:427:18)
at Object.fs.readFileSync (fs.js:284:15)
at Object.module.exports.parseElementtreeSync (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/util/xml-helpers.js:119:27)
at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/util/plugins.js:67:39
at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/shelljs/shell.js:1707:7
at ChildProcess.exithandler (child_process.js:635:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
I tried to manually install the plugin by importing the header files and main files and js file and then by adding feature to config.xml. But that also was a failure,.
Please Help me out to install this plugin in Phonegap 3.0
Within Cordova you can install the plugin from remote location like this:
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git
But I guess you need Git locally installed as a prerequisite. Not sure how the PhoneGap command looks like. Credits go to here.
First thing that comes to my mind when there is no such file or directory is that the directory doesn't exist because whatever tried to create it did not have proper permissions.
Try checking the permissions (this may just be a matter of running it with 'sudo')
It's a longshot, but i found that sometimes the install worked only when i used the cordova command line. download its bin and try the following:
cordova install --platform <android/ios> --project <project dir> --plugin <plugin's git>
I got is solution by using this plugin https://github.com/lite4cordova/Cordova-SQLitePlugin
which offers adding though Cordova CLI commands.
I am trying to create a new project, following:
$ phonegap create test com.temp testX
$ cd test
$ phonegap build ios
$ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
The plugin (device) is successfully downloaded to test/plugins/, but not successfully install to test/platforms/ios/testX/Plugins/. Opening the project in Xcode will show those files are missing. Manually copy and reference them won't completely fix it.
What is the cause of this?
PS: It works if I dont specify the project's name:
//project name will be HelloWorld.xcodeproj
$ phonegap create test
Add the plugin before you build iOS by switching the order of your last 2 commands
Hi "git" is also a node module. Simplest way want i found is.
npm install -g git
This will install git in you node source location as a module.
Restart the machine.
Install phonegap plugin:
C:\Users\user1\yourprojectname>cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
You will get response as:
Fetching plugin from "https://git-wip-us.apache.org/repos/asf/cordova-plugin-cam
era.git"...
Starting installation of "org.apache.cordova.camera" for android
Preparing android project
org.apache.cordova.camera installed on android.
Hope this will be very helpful. If any issue reply.