Cordova 3.3.1-0.1.2 (Phonegap) plugins doesn't work
android, cordova, git, ios, plugins
Solution
Unfortunately, none of the answers worked. Luckily, I found the solution in this mailing list:
http://mail-archives.apache.org/mod_mbox/cordova-dev/201312.mbox/%3CCABiQX1Vat5XvmKkWt=+viL9oXWnOiAz5ee95h8oJp0j4MU9pJQ@mail.gmail.com%3E
There they say, that this is a bug in cordova 3.3.1. In this versions, the plugins get copied into the `.staging` directory of the different platforms.
So, downgrading with npm to cordova 3.3.0 now worked (on Mac OS X):
sudo npm remove -g cordova
sudo npm view cordova versions
sudo npm install -g cordova@3.3.0-rc.1
And also check, if cordova is maybe installed from phonegap too. If you only use cordova, and non of the phonegap features (like remote build), you can safely remove the phonegap package with
sudo npm remove -g phonegap
Update
The current version 3.4.0 works fine, and doesn't have this issues.
Problem
I have a cordova 3.3.1-0.1.2 test project for iOS, where I use the following plugins (`cordova plugin ls`): ``` [ 'com.phonegap.plugins.PushPlugin', 'org.apache.cordova.console', 'org.apache.cordova.device', 'org.apache.cordova.splashscreen' ] ``` I've added the plugins like this `cordova plugin add org.apache.cordova.device`. In my git repo, I see, that it adds a bunch of files to the `plugins/org.apache.cordova.device` directory, creates a `CDVDevice.h` and a `CDVDevice.m` in my iOS plugin directory, updates the `ios.json`, updates the `*.xcodeproj` file and adds the plugins to my `config.xml` inside `platforms/ios/test-app/config.xml`: ``` <feature name="Device"> <param name="ios-package" value="CDVDevice" /> </feature> ``` But when I try to access the `device` or `window.device` property inside JS, it tells me, that `device` is undefined. The weird thing is, that the pushPlugin is present: ``` document.addEventListener("deviceready", function () { console.log(device); console.log(window.device); console.log(window.plugins.pushNotification); }); ``` The `window.plugins` object only lists the `pushNotification` plugin as a property. It's weird, because they are all installed, and during the installation, cordova said, everything was ok. I'm a little bit confused, about the outdated, and mixed-with-phonegap documentation, but that would be ok, if one of them would work. I also saw a plugin definition, inside a `config.xml` like this ``` <gap:plugin name="org.apache.cordova.device" /> ``` Can someone explain me, what's the difference? Is the way (with `feature`) that I'm working outdated with cordova 3.3? When I try to use the `<gap:plugin...` format, my app crashes on startup. So, please help me to fix this, and clear my mind ;)