PhoneGap Build: Upgrading to 3.1.0


As starting from PhoneGap 3.0.0, drastic changes has been made to the popular hybrid app wrapper. Apart from using the latest libraries and project files, 3.0.0 also requires a new way of referencing the device features and plugins. Below is a quick guide on how to upgrade your phoneGap build projects to 3.1.0, all updates are done in the config.xml

Version code

The first step is obviously straightforward, just update the following tag with target version value:

<preference name=”phonegap-version” value=”3.1.0” />

Plugins references

Second step can be a bit confusing. Core device APIs used to be bundled with phoneGap/Codova.js and requires only references as <feature> tags in the config.xml. Since PhoneGap 3.0.0, feature tags are deprecated and all core APIs are implemented as plugins. Hence all device features now needs to be referenced as plugins:

<gap:plugin name=”org.apache.cordova.device” />
<gap:plugin name=”org.apache.cordova.dialogs” />
<gap:plugin name=”org.apache.cordova.network-information” />
<gap:plugin name=”org.apache.cordova.inappbrowser” />

And third-party plugins will require the same syntax as above:

<gap:plugin name=”com.phonegap.plugin.statusbar” />
<gap:plugin name=”nl.x-services.plugins.ioswebviewcolor” />

A full list of plugins and their reference names can be found here:
https://build.phonegap.com/plugins


The good news is the JS APIs are not changed, meaning there is no need to update our existing projects’ source code.

Email me when Johnny Xu publishes or recommends stories