Quantcast
Channel: SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 789

Hybrid UI5 App - Cordova plugin version management in WebIDE

$
0
0

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":

plugin1.png

"Device Configuration" (Only available if it's a mobile project) ==> Plugins ==> Custom ==> Add or Remove

 

plugin2.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.

 

plugin3.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

plugin4.png

 

Add the version to the cordova plugin

 

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

 

plugin5.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


Viewing all articles
Browse latest Browse all 789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>