Error adding Device plugin with Phonegap 3

Viewed 988

I'm using Phonegap's Command Line Interface to create and build Phonegap apps. The version I am using is 3.1.0-0.15.0. I need to install the Device plugin to simply find out what platform the app is currently running on. I did this with the following command:

phonegap local plugin add https://github.com/apache/cordova-plugin-device

This worked fine and Device plugin is successfully installed. In config.xml I see:

    <feature name="Device">
        <param name="android-package" value="org.apache.cordova.device.Device" />
    </feature>

I then build the android app:

phonegap local build android

However, when I run on a device I get the following error:

W/System.err(24625): java.lang.ClassNotFoundException: org.apache.cordova.device.Device
W/System.err(24625):    at java.lang.Class.classForName(Native Method)
W/System.err(24625):    at java.lang.Class.forName(Class.java:234)

...

and:

I/System.out(26075): Error adding plugin org.apache.cordova.device.Device.
D/PluginManager(26075): exec() call to unknown plugin: Device

When I run:

phonegap local plugin list

I get:

[phonegap] com.phonegap.plugins.PushPlugin
[phonegap] org.apache.cordova.device

I have cleaned the project a number of times. Any ideas??

1 Answers
Related