Ardenexal
Ardenexal

Reputation: 543

plugins not working in android phonegap

For some reason that i am not sure of plugins are not being called when running on android. It does however work on IOS which makes it all the more difficult to determine to problem, i have looked at the console log and the android logs but there are no calls to any of the plugins. The content on the page though does load

the plugins installed are

"installed_plugins": {
    "com.phonegap.plugin.statusbar": {
        "PACKAGE_NAME": ""
    },
    "nl.x-services.plugins.calendar": {
        "PACKAGE_NAME": ""
    },
    "org.apache.cordova.dialogs": {
        "PACKAGE_NAME": ""
    },
    "org.apache.cordova.inappbrowser": {
        "PACKAGE_NAME": ""
    },
    "com.boyvanderlaak.cordova.plugin.orientationchanger": {
        "PACKAGE_NAME": ""
    }
},

android seems to be adding them to the build and they are loading into cache but i can't make any calls to them.

I am using Phonegap/Cordova 3.4.0 and building for Android 4.4.2

Thanks in advance

Upvotes: 1

Views: 332

Answers (2)

Ardenexal
Ardenexal

Reputation: 543

After much search i figured it out apparently if some of you plugins are only designed for particular platforms like iOS's StatusBar or Android's orientation changer plugins you need to add them in as a feature otherwise other plugins don't seem to load properly.

Example for iOS

<feature name="StatusBar">
    <param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>

Example for iOS

<feature name="OrientationChanger">
    <param name="android-package" value="com.boyvanderlaak.cordova.plugin.orientationchanger.OrientationChanger" />
</feature>

Hopefully this help anyone else with the same problem

Upvotes: 1

iamsuman
iamsuman

Reputation: 1413

If you are building an application in phonegap you can use the command line tools to add the required plugin like this plugins are stored in the repository you can use this

 $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git

or you can go for repository here

phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git

Upvotes: 1

Related Questions