Hi all,

Introduction

I’ve been working on a Hybrid Mobile App based on Cordova. Therefore I’ve used the WebIDE and the Hybrid App Toolkit for my developments.

Problem description

During the developments I had the need to use a cordova plugin, “cordova-sqlite-storage”:

https://www.npmjs.com/package/cordova-sqlite-storage

I didn’t just need this plugin, I needed a specific version.

On your local pc it’s easy to add a version when you’re adding a plugin to your cordova project. You can use the following command:

cordova plugin add <plugin[@<version>]

I’m using the SAP WebIDE which executes all the commands for you. This makes it all very easy to generate your cordova project with all the required plugins. But it also makes it difficult to manipulate and control the cordova project. This is how I was able to add the version to a cordova plugin from in the SAP Web IDE.

The Solution

Add a cordova plugin

Go to the “Project Settings”:

/wp-content/uploads/2016/06/plugin1_967832.png

“Device Configuration” (Only available if it’s a mobile project) ==> Plugins ==> Custom ==> Add or Remove

/wp-content/uploads/2016/06/plugin2_967835.png

Search for your plugin. The first thing I’ve tried was adding the version at this point. But as you can see… Error, not possible.

/wp-content/uploads/2016/06/plugin3_967836.png

Because that didn’t work out, I just added the plugin without a version:

Plugin name ==> “+” ==> “OK” ==> You’ll see the plugin in the list of custom Cordova plugins

/wp-content/uploads/2016/06/plugin4_967837.png

Add the version to the cordova plugin

For adding the version to the cordova plugin go to the “.project.json” file:

/wp-content/uploads/2016/06/plugin5_967838.png

Search for your plugin and add “@” behind the name of the plugin together with the version number:

==> “registry”: “<plugin name>@<version number>”

plugin 6.png

The next time that you deploy the Hybrid app to the “Hybrid App Toolkit” it will use the version that you’ve defined in the configuration.

Hope it can help you and save some research 🙂

Kind reagards,

Wouter

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply