Skip to Content

Getting Started with Kapsel – Part 1


SAP Mobile Platform 3.0

Getting Started with Kapsel

Note, that there were significant changes to the Kapsel plugins when moving from SP08 to SP09 and the move from Cordova 4.2.0 to 5.1.1. The following instructions are for SP08. If you are using a newer version of the SDK, please see Getting Started with Kapsel in SP09+.


One type of mobile app that can be written using the SAP Mobile Platform 3.0 (SMP 3.0) is an HTML5 hybrid app or Kapsel app.  Apache Cordova is an open source project that provides a container which includes a browser that renders the UI of the application and a set of API’s callable from JavaScript to access native device functionality such as the device’s camera and contacts list.  The benefit of this is that the same UI code (HTML/CSS) and business logic code (JavaScript) can be deployed on multiple platforms such as iOS and Android without code modifications.  For a complete list of Kapsel supported device versions see SAP Mobile SDK Supported Devices Operating Systems, Product Availability Matrix and Supported Kapsel Plugins for Windows 8.1 and Windows 8.1 Phone.    The list of Apache Cordova API’s including sample code is available at API Reference.  Apache Cordova itself can be extended to provide additional native device functionality.  For additional details on writing a Cordova plugin see Plugin Development Guide.

Kapsel is a set of plugins that enhance Apache Cordova with functionality such as a stream-lined logon to an SMP 3.0 server, the ability to update deployed applications, encrypted storage and push notifications.  For more information see SMP 3.0 Enablement, the Kapsel specific enablement page at SMP 3.0 for Developers – Hybrid Apps, the blog posts by John Wargo, Kiran Karunakaran the SMP SDK product manager, the roadmap for SMP at and the SAP Web IDE.


Kapsel apps can be developed on Windows or Mac machines.  Kapsel apps can target Android, iOS and as of SP05 Windows 8.1 and Windows 8.1 Phone.  Development for an iOS device must occur on a Mac machine.  Android development can occur on a Windows or Mac machine.  See also Creating an Application on Windows 8.1 and Windows 8.1 Phone.

SMP 3.0

The SAP Mobile Platform and the SAP Mobile Platform SDK can be downloaded from the SAP Software Download Center.  Additionally, a trial version of the SAP Mobile SDK is available at SMP 3.0 Mobile SDK Trial.  The cloud version of the SMP server named SAP HANA Cloud Platform mobile services or HCPms server is also available as a trial.  The examples shown in this guide were tested using the SP08 PL01 SDK and the on premise SP07 server and it is recommended that theses versions or newer be used when following the examples.  Note, that the server and SDK are on different release schedules.

Two files need to be downloaded to install the SAP Mobile Platform 3.0.  The 3.0 SP08 SDK and the 3.0 SP07 on premise server.  The latest patch levels or PLs should also be applied.

Under Installation & Upgrades, A-Z Alphabetical List of my Products > M >  SAP Mobile Platform SDK > SAP Mobile Platform SDK 3.0 > Support Packages > SAP Mobile Platform SDK 3.0 > Windows on x64 64-bit > EBF 3.0 SP08.

Click on M > SAP Mobile Platform > SAP Mobile Platform 3.0 > Support Packages and Patches > SAP Mobile Platform Runtime 3.0 > Windows on x64 64bit and download EBF 3.0 SP07.

To double check what version of the SDK installed, edit a plugin’s plugin.xml file.  It should contain a version field such as the one shown below.

<plugin xmlns=""

The SMP server is a bit more tricky to determine its version.  There are multiple places where it indicates a version.  The most reliable may be to look at C:\SAP\MobilePlatform3\smp_product_info.xml.  It should contain a version field as the one shown below.

<product name="SMPServer" version="" compatibilityVersions="3.0.*">

One other place is in the top right of the management cockpit.

Additional Required Software

The Apache Cordova command line will generate a project that can then be built using Android SDK or Xcode.

The Android  SDK also requires Java to run. Note, that as of SP08 of the Kapsel SDK with Cordova 4.2, it is still recommended to use Eclipse with the Android SDK.  See Installing the Eclipse PluginAndroid Studio will be replacing the ADT plugin for Eclipse in a future release.  To successfully use Apache Cordova for Android, a JAVA_HOME variable must be specified and it should be added to the windows path.

JAVA_HOME=C:\Program Files\Java\jdk1.7.0_45

The Android SDK tools\bin folder also needs to be added to the windows and mac (.bash_profile) path.



export PATH=$PATH:~/Downloads/adt-bundle-mac-x86_64-20130522/sdk/tools

If you are using Windows, Git for windows is a prerequisite and must be in the path.  Git can be installed from Git for Windows or git-scm.

On a Mac, Git is installed as part of Xcode.  The following commands can be used in OS X to view the version installed and to verify that it is on the path.

git --version
pkgutil --file-info /usr/bin/git
echo $PATH

If needed it can be installed from Git for Mac.

Finally if using Android, ant should be installed and added to the path.


Accessing the SAP OData Gateway Demo

Kapsel apps communicate with backend enterprise systems primarily by using OData.  For additional information on OData see Appendix A:  OData.  SAP provides a publicly available OData endpoint at SAP Netweaver Gateway Demo System.  Some of the samples in this guide will utilize this.  Follow the instructions on the previously provided link to receive a user name and password necessary for accessing the OData source used throughout this guide.

Ensure that the OData endpoint can be accessed by opening it in a browser.

Enter the provided user name and password.

CarrierCollection is the collection that will be used.

CarrierCollection returns a list of airlines.

Note that the option ?sap-ds-debug=true can be used with SAP Netweaver Gateway OData sources.  This causes HTML to be returned to the browser enabling the content to be displayed in an easier to read format and the links become clickable.

Notice that https is used.  The following step adds the certificate of the SAP Netweaver Gateway server to the SMP 3.0 server.  This is needed as the SMP 3.0 keystore


does not contain the trusted root certificate that was used to sign the certificate used by the SAP Netweaver Gateway server.

Right-click and choose View page info > Connection > Certificate Information.

Click on the Details tab, Copy To File… to export the certificate to a local cer file which can then be imported into the SMP 3.0 server’s keystore.

C:\SAP\MobilePlatform3\Server\configuration>keytool -import -v -alias sapgatewaycert -keystore smp_keystore.jks -storepass changeit -file c:\certs\sapgatewaycert.cer

Note, the password shown above, changeit, was a value that was requested during the SMP 3.0 server install.  Replace changeit with the value you specified during the install.

Note that the SMP 3.0 server needs to be restarted after making this change.

The above step demonstrates how to enable the SMP 3.0 server to trust the OData server’s certificate by installing the certificate (sapgatewaycert.cer) into the SMP 3.0 server’s keystore.  Alternatively, the certificate belonging to the entity that signed the OData server’s certificate (Starfield) could be installed.
Here are a few more useful keytool commands

keytool -list -v -keystore smp_keystore.jks
keytool -list -v -keystore smp_keystore.jks -alias sapgatewaycert
keytool -delete -alias sapgatewaycert -keystore smp_keystore.jks

Configuring a Kapsel App in the Management Cockpit

The SMP 3.0 server provides authentication, logging and the ability to rewrite the URLs of an OData endpoint.  The SMP authentication providers enable the use of an existing authentication system to authenticate users accessing mobile applications.  Rewriting URL’s can hide from the end user the host name of the OData endpoint.

The following steps will demonstrate how to configure a new hybrid or Kapsel app in the SMP 3.0 management cockpit.

Create a new application in the management cockpit.  The management cockpit can be accessed at https://localhost:8083/Admin/.

The default user is smpAdmin and password is whatever was specified during the install.

Click on Applications > New.  The id is



The OData endpoint URL is


Under SSO Mechanisms, click on Add > Technical User (Basic) and specify the user name and password used to access the OData backend system.

The Use System Proxy should be checked if the computer uses a proxy server.  The values for the system proxy are set in the management cockpit under Settings > System.

It is also recommended to set http.nonProxyHosts setting when using the http.proxyHosts setting if using the httpAuthentication provider against a server within your corporate network.

Under the Authentication tab, the simplest thing to do is to choose the default configuration.  When the No Authentication Challenge authentication provider is used, any user name and password passed to the SMP server will succeed during the registration process.image11.PNG

In a non demo scenario, one of the other authentication providers would be used.


An alternate setup would be to use the Basic SSO mechanism with the HTTP/HTTPS Authentication provider.  Note the HTTPS Authentication provider does not currently work with a URL that requires a proxy to reach it.

The following screenshot shows the result of a registration done using the No Authentication provider and the HTTP Authentication provider.  With the No Authentication provider, each user apears with a user name of nosec_identity.  The steps to perform the registration are covered in the Logon plugin section.

Ping the endpoint to confirm that it is correctly configured.

The application is now configured in the SMP 3.0 server and ready to be implemented.

Installing Apache Cordova with Node.js

Note, execute the following commands using the Windows command prompt or the OS X terminal.

If necessary, download and install Node.js from

Node.js and its package manager npm can be used to install Apache Cordova.  The version installed can be seen by the following node command

node -v

I would recommend using the latest available 0.10.x version.  The following error occurs when using Cordova 4.3.0 and Node 0.12.1.

Request path contains unescaped characters

To see what packages are already globally installed use

npm ls -g

Use npm to install the Apache Cordova command-line interface.
Cordova 3.0.6 (or the latest 3.0.x version) should be used if using SMP 3.0 SDK.
Cordova 3.1.0-0.2.0 (or the latest 3.1.x version) should be used if using SMP 3.0 SP01 SDK.
Cordova 3.3.1-0.1.2 (or the latest 3.3.x version) should be used if using SMP 3.0 SP02 SDK.
Cordova 3.4.0-0.1.3 should be used if using SMP 3.0 SP03 SDK.
Cordova 3.4.1-0.1.0 should be used if using SMP 3.0 SP04 SDK.

Cordova 3.5.0-0.2.7 (or the latest 3.5.x version) should be used if using SMP 3.0 SP05 SDK.

Cordova 3.6.3-0.2.13 (or the latest 3.6.x version) should be used if using SMP 3.0 SP05 PL03 or SP06 SDK.

Cordova 4.2.0 should be used if using SMP 3.0 SP07 SDK.

Cordova 4.2.0 should be used if using SMP 3.0 SP08 SDK.

For SP09 see Getting Started with Kapsel in SP09+

Note, it is possible to use Cordova 4.3.0 with SP08 of the SDK but it requires using the following format when adding Kapsel plugins.

cordova plugin add C:\SAP\MobileSDK3\KapselSDK\plugins\logon --searchpath C:\SAP\MobileSDK3\KapselSDK\plugins


cordova plugin add --searchpath C:\SAP\MobileSDK3\KapselSDK\plugins

Additional information is available at The Command-line Interface.

npm install -g cordova@4.2.0
npm ls -g cordova or cordova -v

Note, the -g indicates that Apache Cordova should be installed globally.  It will be placed at the location indicated by

npm root -g

Note if you are on a Mac, use

sudo npm install -g cordova@4.2.0

A specific version of Apache Cordova can be installed by specifying a version number or if the version number is not supplied then the latest version is installed.

npm install -g cordova@4.2.0

The available versions can be seen with the info command.

npm info cordova

Note, if you use a proxy server you will need to configure npm, git and plugman as shown below.

npm config set proxy http://proxy:8080
npm config set https-proxy http://proxy:8080

git config --global http.proxy http://proxy:8080
git config --global https.proxy http://proxy:8080

Create a file named C:\Users\i82xxx\.plugman\config or /Users/i82xxx/.plugman/config.

Specify a proxy such as proxy=

See also CB-5017.

If these are not set an error similar to the one shown below may appear when creating a project.

[Error: downloaded www assets in /Users/user_name/.cordova/lib/www/cordova/4.0.0/www does not contain index.html, or www subdir with index.html]

If this happens, delete C:\Users\user\.cordova\, set the proxy settings and rerun the create command.

The following are for illustration purposes and demonstrate how to list the current proxy settings and remove the proxy settings.

npm config list

npm config get proxy
npm config get https-proxy
npm config delete proxy
npm config delete https-proxy

git var -l
git config --global --get http.proxy
git config --global --get https.proxy
git config --global --unset http.proxy
git config --global --unset https.proxy

Uninstalling Apache Cordova

Cordova can be uninstalled by

npm uninstall -g cordova
npm cache clean

After performing the uninstall, if the following folder exists, you may wish to also delete it.


or on a Mac


Creating an Apache Cordova Project

The command-line interface or CLI is used to create Cordova projects.  For additional details see Command-line Interface.

Create a folder to hold the Kapsel projects such as C:\Kapsel_Projects or ~/Documents/Kapsel_Projects
A new project can now be created using

cordova -d create C:\Kapsel_Projects\LogonDemo com.mycompany.logon LogonDemo "{\"plugin_search_path\":\"C:/SAP/MobileSDK3/KapselSDK/plugins/\"}" 

or on a Mac

cordova -d create ~/Documents/Kapsel_Projects/LogonDemo com.mycompany.logondemo LogonDemo "{\"plugin_search_path\":\"/Users/i826567/SAP/MobileSDK3/KapselSDK/plugins/\"}"

When installing plugins, the CLI expects plugins to be installable from the hosted Apache Cordova plugins registry.  The plugin_search_path parameter provides a location where local plugins can be found.  It is now required when using Kapsel plugins in SP04.  In previous versions of Kapsel there was a local .git folder that was being used to resolve the location of dependent Kapsel plugins.  The search path value is stored in C:\Kapsel_Projects\LogonDemo\.cordova\config.json or  ~/Documents/Kapsel_Projects/LogonDemo/.cordova/config.json.  Note it is also possible to specify a searchpath when adding a plugin.  Type cordova help and examine the plugin add command for additional details.

The first parameter following create is the directory to create the project, followed by a reverse-domain-style identifier, followed by the project name and then a JSON string defining where to find the Kapsel plugins when they are added to this project.
Note, this may take a few minutes to complete as an initial download of the template project that will be used has to be downloaded to




Note, the -d flag indicates debug output and is optional but can be useful the first time this is run in case something goes wrong.

Note, on a Mac, if the above command fails due to a permission problem, it may be necessary to provide execute rights to the folder where Cordova was installed.

cd /usr/local
sudo chmod +r+x bin

To add a platform run the following command

cd C:\Kapsel_Projects\LogonDemo or cd ~/Documents/Kapsel_Projects/LogonDemo
cordova -d platform add android


cordova -d platform add ios

or both at once if you are on a Mac

cordova -d platform add android ios

At this point,


contains the HTML, JavaScript and CSS used by the project. 

The files contained in here are the ones that should be modified.  A duplicate set of the files are included in each of the below directories.



A plugin can be added with the following command.  The below plugin enables console.log to display log messages.

cordova plugin add

For a list of additional plugins click on one of the API’s such as Camera at Plugin APIs.

Changes would now be made to index.html file followed by calling the prepare command to copy the files in the project/www folder to the platform specific www folders.

cordova -d prepare android ios

At this point the project can be opened in a development environment such as Xcode or the Eclipse IDE that includes the Android Development Tools plugin.  Alternatively, the cordova command line can also be used to build and deploy the project.

The following are a few examples using the Cordova CLI and the Android SDK.

cordova compile android (creates an apk file that can then be installed)
emulator -avd Android51 (starts an existing Android emulator named Android51)
adb install platforms/android/ant-build/CordovaApp-debug.apk (installs the app on a running device or emulator)
cordova run android (performs a cordova prepare, then builds the apk and installs the app and runs it)

Note to open the project in Eclipse and then run it choose File > Import > Android > Existing Android Code Into Workspace. 
Note that with Cordova 4.2.0, an additional step is needed to enable the project to build in Eclipse.  Right-click on the project and choose properties > Java Build Path > Libraries > Add Jars > CordovaApp-CordovaLIb > bin > cordovaapp-cordovalib.jar.  Under the tab Order and Export check cordovaapp-cordovalib.jar.
Then right-click on the project and choose Run As > Android Application.

To open the project in Xcode, double click on the file


Kapsel Plugins

The following sections provide step by step instructions demonstrating each Kapsel plugin and a set of appendices on topics related to Kapsel app development.  Note some of the plugins mentioned below such as the Barcode Scanner, Calendar, and Print plugins are based on third party plugins. They are included in the Kapsel SDK for your convenience.
Online Application (New in SP04)
Toolbar (New in SP04)
Barcode Scanner (New in SP04)
Application Preferences (New in SP04)
Cache Manager (New in SP04)
SAP Fiori Client (New in SP04)
Offline OData (New in SP05)
End-To-End Trace (New in SP05)
Attachment Viewer (New in SP05 PL03)

Calendar (New in SP06)

Printer (New in SP06)

Voice Recording (New in SP08)

Appendix A:  OData
Appendix B:  Debugging
Appendix C:  UI Frameworks
Appendix D:  Security
Appendix E:  Upgrading
Appendix F:  Tips
Appendix G:  New Features
Appendix H:  Non Kapsel Plugins
Appendix I:  SAP Afaria and Kapsel
Appendix J:  SMP Server Cloud Version
Appendix K:  Hybrid Apps in SAP Mobile Platform 2.3 and 3.0
Appendix L:  Crosswalk
Appendix M: SAP HANA Cloud Platform Mobile Services (HCPms)
Appendix N: Using SAML with Kapsel

Note that comments are not easily searchable in SCN.  If you have a question that is not specific to the above content it would be best to create a new discussion on SCN.
To include a reference to this document, Right Click on the title and select ‘Copy Shortcut’.  Paste it into the newDiscussion so people will know the relevance.  If you want to bring it to the attention of the author, repeat the same process with the Author’s name.

You must be Logged on to comment or reply to a post.
  • /
  • Thanks for sharing this post.


    I'm getting an error with the ping test failing. In the log, I see " cause::: peer not authenticated|"


    Not sure if it's related but I noticed that "keytool" is found in two locations (but not the path shown in the post) on my server.


    The import works with my keystore password if I run it from "C:\SAP\MobilePlatform3\sapjvm_7\jre\bin", but if I run it from "C:\SAP\MobilePlatform3\sapjvm\bin"

    I get an error that the "Keystore was tampered with, or password was incorrect".


    I assume that the "jre\bin" folder is where the import should be run from but that's the only difference from my steps. Restarted service and server after the import.


    Am not using proxies and the I can access the endpoint directly from browser on the server.


    Thanks in advance for any suggestions.

    • My path includes c:\Program Files\Java\jdk1.7.0_45\bin.  I believe that is the version of keytool that I am using.


      Have you restarted the SMP 3.0 server after making the change to smp_keystore.jks?

      • Yes, I restarted the server after making the change. I noticed I only had the JRE, not JDK so installed it, added JDK bin to my path, ran keytool again to delete, re-import, re-started the server.

        Also tried deleting that application entry, re-created it, same results, same message in log. Any other suggestions ? Thanks !


        Assuming it shouldn't make a difference but am running this in EC2 and I can access the endpoint from the server browser.

        • I tried to replicate the problem.  If I remove the certificate from the keystore and perform a ping I get the same error message.


 cause::: peer not authenticated


          Once I add it back and restart the SMP 3.0 server I no longer get the error.  Perhaps try exporting the certificate and installing it again?  Alternatively you could export and then import the two starfield certificates and try those.


          Another option would be to use another OData source that does not use HTTPS such as

          See the OData appendix for more details.  Getting Started with Kapsel - Appendix A -- OData

          • Thanks Daniel.


            I tried exporting the file again from another Chrome browser on another PC, deleting previous one, re-importing, restarting server but same message. I think there's something different from the cert that I'm exporting somehow. Assuming you are allowed to, are you able to make available to us the cert you exported ?

            If not, which ones of the Starfield certs should we be importing alternatively, assuming they're from the URL below ?



            PS I tried the HTTP OData source for Products and that pings OK but assume the rest of the tutorial will require the Flight endpoint.

          • Below I have included the smp_keystore.jks file that includes the certificate that was exported from



            You can view it by running


            keytool -list -v -keystore smp_keystore.jks -alias sapgatewaycert


            I would shut down your SMP 3.0 server, rename the existing file at


            and then unzip the one from here.


            Restart your SMP 3.0 server by running




            Then in the management cockpit, under Settings > Connections, select com.mycompany.logon and press the ping button.


            Here is the link that contains the smp_keystore.jks with the certificate from my SMP 3.0 SP02 server.  Note the link will be valid for 7 days.


            SAP Box Attachment


            Please let me know if that helps.


            The samples in the rest of the guide are fairly simple and very specific to the plugin or example they are showing.  Most of them do not use the OData source.  I think you could proceed without getting this step working.


            For the starfield certs, you could export the two shown in the image below.  Select the top one, change to the Details tab and click copy to file.  Then click the second one, change to the Details tab and click copy to file.Capture.PNG




            Dan van Leeuwen

          • Hi Daniel, I tried your workaround but SMP didn't seem to like it, presumably because we would have imported the cert with different SMP server passwords ?

            I was wondering if there might be a difference in the cert file produced due to differences in browser / OS versions and I was hoping to try to import into my server the certs that work for you.

            I also noticed that I have not applied any Service Packs on my SMP server - I noticed your tutorial asks us to get SP2 for the SDK, but you haven't listed any SP for the server itself so assume that's not an issue ?

            I'm using another HTTP oData endpoint for now so it's not a showstopper but would be good to be able to get pass this at some stage, thanks.

          • The file smp_keystore.jks will have a password.  The SMP 3.0 server needs to know what the password is.  The smp_keystore.jks that I included was from an 3.0 SP 02 version of the server and has a password of changeit.


            If your SMP 3.0 server is using a different password for the keystore, you could change the password for the keystore I provided using the following command


            keytool -storepasswd -keystore smp_keystore.jks



            I would recommend upgrading both the SDK and server to SP 02.

          • Eugene,


            Try installing this software to view what's on the smp_keystore.jks file. It will also allow you to easily import any certificates based on host and port of the destination web site where the OData endpoint is without needing keytool knowledge.


            Be careful while using this program - always backup the jks file before tampering with it.


            When you click on the button "Examine SSL" the app will validate the SSL connection and will allow you to import the certificates directly into SMP's keystore.


            A common issue with certificates is that you must have all certificates in the certification path in order for SSL to work. That's the reason why you need root certificates an intermediate certificates up-to-date according to the corresponding CAs.

            In other words the certificate from web site in question will be invalid if you don't have the issuer's certificates.


            Good luck!



  • /
  • Daniel Van Leeuwen


    I was trying to add below plugin as per below syntax. But getting error as mentioned in the screenshot.

    A plugin can be added with the following command.  The below plugin enables console.log to display log messages.
    cordova plugin add


    What i noticed is:

    As soon i run this command cordova plugin add, folder '1405273622733' appears and disappears soon.


    I dont see folder '1405273622733' under this path C:\Users\Jitendra\AppData\Local\Temp\plugman\git

    What could be the wrong?




  • Hi All,


    When i configuring for kapsel application development i got following the error when the time of cordova plugin's installation.



    Please help me where i am in wrong.



    Ranjith Lingala

      • Thank you Jitendra for your quick response.


        I already check that one it's working fine. Please find the below screen for more information.


        And then where is the problem please help me on the same.

        And i did everything whatever in above document and as well as, but i didn't find out where exactly the problem for installing cordova plugin's, if u have any step by step guide please share me.




          • Hi Jitendra,


            We are not using any proxy server for accessing internet we are accessing internet directly without proxy server, then what i want to do for this case please help me on the same.





            Best Regards,


          • Ranjith Lingala


            If you are not using proxy, you may remove it by running these commands:

            npm config delete proxy

            npm config delete https-proxy

            Can you confirm what is SMP 3.0 mobile SDK version you are working on?

            Make sure to install following cordova version against existing mobile SDK


            Cordova 3.3.1-0.1.2 (or the latest 3.3.x version) should be used if using SMP 3.0 SP02.

            Cordova 3.4.0-0.1.3 should be used if using SMP 3.0 SP03.

            Cordova 3.4.1-0.1.0 should be used if using SMP 3.0 SP04.

            e.g. npm install -g cordova@3.4.1-0.1.0 (for SMP mobile SDK 3.0 SP04)



            Note: not sure if it is correct since you were trying with only npm install -g cordova@3.4.0

          • Hi Jitendra,


            Thanks for your quick support and that is the problem only because i am not using any proxy for internet, and i deleted using npm for both http and https proxy's probelm will be solved.


            And i have another query related to Agentry, right now i am using SMP 3.0.

            I installed both SMP 3.0 Server and SMP 3.0 SDK without any problem.

            Under SMP SDK 3.0 following are the Agentry related components.

            Agentry Components.PNG



            By above screen i didn't find latest Agentry Server 7.x.x related information.

            In previous version of like SMP 2.3, whenever we installed SMP 2.3 SDK in that every components will be available with including Agentry Server 6.x.x. Please find the below screen for better understand.

            Agentry Server.PNG

            Now in SMP 3.0 SDK or SMP 3.0 Server i didn't find anywhere latest Agentry Server 7.x.x component. Where i need to find the same. Please help me on this query.



            Ranjith Lingala

  • Hi All,


    I am close to execute Android application using cordova plugin's with SMP 3.0 Kapsel development,

    Now i am in end of this part like "Getting Started with Kapsel - Part 1"


    In that whenever i run this (cordova -d prepare android) command " i am getting following error please find below screen.

    cordova erro when prepare command.jpg

    And after generation of the application i import the same application with my android eclipse (eclipse-SDK-3.7.2-win32-x86_64) then i run that application in emulator i am getting error in emulator like "Unfortunately, 'appname' has stopped". Please find the screenshot for better understand.

    android cordova error.jpg


    Please find the logcat also.


    log cat.jpg

    So anybody help me.




      • Hi Jitendra,


        I try the same whatever you shared and application is working fine without any issue, problem is that only i am trying that command some other path now problem is solved and i understand.


        Thank your excellent support and response.


        Best Regards,

        Ranjith Lingala

  • Hi all,


    I am trying to add android platform using

    cordova -d platform add android

    But i am getting the below error:



    I have cross checked the path in the environment variable it is pointing to the ant bin correctly.


    Please let me know your inputs on the same




  • Hi,

    when I try to add the android platform to my cordova (3.5.0-0.2.6) project, I get the error "Please install Android target 19 (the Android newest SDK).".


    When I run "android" in my command-line, I see the following version information:


    Do I have to "downgrade" my Android SDK version somehow? Or is there another problem?

    Thanks and best regards


    • Hi Felix,


      I faced the similar issue and here is what i did after googling the issue.


      Goto C:\Users\<user>\.cordova\lib\android\cordova\<version>\framework


      There is a file, change the target here to

      target=android-19 and run the command, it should work.




  • I am using SMP SDK 3.0 SP05  with Cordova 3.5.0-0.2.7  and getting error while fetching dependent plugins using logon. Please assist me. Thank You

    ScreenHunter_05 Nov. 07 01.22.jpg

    ScreenHunter_05 Nov. 07 01.22.jpg
    • I would try deleting your project and recreating it.  When you create your project be sure to add the plugin_search_path parameter.  It is this parameter that tells plugman where to locate the plugin.


      For example


      cordova -d create C:\Kapsel_Projects\LogonDemo com.mycompany.logon LogonDemo "{\"plugin_search_path\":\"C:/SAP/MobileSDK3/KapselSDK/plugins/\"}"

      • Hi Daniel,

        Since I upgraded to SP05 from SP03 and also server, SAPUI5 files don't seem to be loading. This is what I got on console while debugging. Is there any reason and how can I rectify it.. Thank You

        IAB close, NO_WINDOW Utils.js:4

        processMessage failed: Error: Error: found in negative cache: 'sap/ui/model/odata/ODataModel.js' from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/ODataModel.js: Error: found in negative cache: 'sap/ui/model/odata/ODataUtils.js' from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/ODataUtils.js: Error: found in negative cache: 'sap/ui/model/odata/Filter.js' from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/Filter.js: Error: found in negative cache: 'sap/ui/model/Filter.js' from resources/sap/ui/core/library-preload.json/sap/ui/model/Filter.js: Error: found in negative cache: 'sap/ui/model/FilterOperator.js' from resources/sap/ui/core/library-preload.json/sap/ui/model/FilterOperator.js: TypeError: Cannot call method 'getObject' of undefined cordova.js:1044

        processMessage failed: Stack: Error: found in negative cache: 'sap/ui/model/odata/ODataModel.js' from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/ODataModel.js: Error: found in negative cache: 'sap/ui/model/odata/ODataUtils.js' from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/ODataUtils.js: Error: found in negative cache: 'sap/ui/model/odata/Filter.js' from resources/sap/ui/core/library-preload.json/sap/ui/model/odata/Filter.js: Error: found in negative cache: 'sap/ui/model/Filter.js' from resources/sap/ui/core/library-preload.json/sap/ui/model/Filter.js: Error: found in negative cache: 'sap/ui/model/FilterOperator.js' from resources/sap/ui/core/library-preload.json/sap/ui/model/FilterOperator.js: TypeError: Cannot call method 'getObject' of undefined

        • I have not seen that error before.  Are you encountering the error when following a specific example from this guide or is this in your own custom app? 


          There are a few hits if you Google for "Found in negative cache"

    • When I added the plugin first and then created the android platform, this error occurred. But when created android platform and then added the plugin. Worked just fine!

  • Hi,

    Can someone please share a sample iOs app in which Push Notifications are working?

    Better if the app is integrated with SMP Server (SP04 or later).


    My configurations are done on the SMP side, but i don't know how to use the Push Plugin from Javascript side.

    As in how should i use the Javascript API to get the APNS token and how this token is sent to the SMP Server during registration?

    I am trying a fiori client application.

    Thanks and appreciate your help.




  • Daniel,


    A good tip is also stated on note "2036005 - Failed to install '' errors while building SMP 3.0 SP03 Kapsel applications for iOS or Android".


    While adding SAP plugins to a Cordova project I faced an issue where I had to install each dependency one-by-one according to the error message. Apparently, by doing a "git init" this will solve the problem.




    • As of SP04 of the SDK, Kapsel plugins are now resolved using the plugin_search_path as shown below.


      cordova -d create C:\Kapsel_Projects\LogonDemo com.mycompany.logon LogonDemo "{\"plugin_search_path\":\"C:/SAP/MobileSDK3/KapselSDK/plugins/\"}"


      So as of SP04 of the SDK, the git init workaround should no longer be needed.

  • Daniel,


    Where did you find the information regarding compatibility between Cordova and SKD versions? I cannot find an SAP Note that could clearly state the relationship between Cordova and SDK versions.




    • Hi Ivan,

      Getting Started with Kapsel - Appendix E -- Upgrading


      This might help you to check with cordova version compatible to SMP 3.0 SP03 Kapsel


      Cordova 3.0.6/3.0.9 -> SMP SDK 3.0

      Cordova 3.1.0-0.2.0 -> SMP SDK 3.0 SP01

      Cordova 3.3.1-0.1.2 -> SMP SDK 3.0 SP02

      Cordova 3.4.0-0.1.3 -> SMP SDK 3.0 SP03

      Cordova 3.4.1-0.1.0 -> SMP SDK 3.0 SP04

      Cordova 3.5.0-0.2.7 -> SMP SDK 3.0 SP05

      It helped me to get solution. Try this


    • I try to keep this information up to date in this document in the location mentioned by Avinash or on this page under the section titled "Installing Apache Cordova with Node.js".


      The public documentation would be another location to find this information.


      See the section named "Installing the Apache Cordova Command Line Interface" at


      • Hi Daniel,


        The code was working fine until I got this problem it says



        CordovaLog(26008): file:///android_asset/www/js/index.js: Line 41 : Uncaught TypeError: Cannot call method 'querySelector' of null


        I tried putting index.js at different places before and after jquery.

        <script type="text/javascript" src="cordova.js"></script>

        <script type="text/javascript" src="js/index.js"></script>

        It seems ("deviceready", init, false) event is not fired.

        Can you suggest me if am wrong.

  • Hi Daniel,


    Great document, I use it allot .


    I have an issue (described also in here SAPUI5 - Context transfer ).


    I'm trying to push 2 models to the same page, and some suggested that I might need some routing in my app.


    I tried using OpenUI5 SDK - Demo Kit with little to no success. If this:

 "Application", {

      metadata : {

      routing : {

      config : {





      clearTarget : false


      routes : [


               pattern : "",





               pattern : "",

               name : "Order",

               view : "Order"





    Doesn't generate an error (since I saw this used with a shell app and sap.ui.core.UIComponent.extend) when I try to initialize the router, I get an error:


    processMessage failed: Error: TypeError: Object [object Object] has no method 'getRouter'

    using this in the same"Application"):

    init : function() {

      var router = this.getRouter();

      this.routeHandler = new sap.m.routing.RouteMatchedHandler(router);




    Any idea what should I do ?




  • But for windows 8.1 application it need something more? Because i have lot of problem with logon plugin.


    once is this after call sap.Logon.init


    Unhandled exception at line 100, column 33 in ms-appx-web://ae570560-9b13-11e4-aa30-7ff15e6cad23/www/smp/logon/ui/resources/sap-ui-core-nojQuery.js

    0x800a139e - JavaScript runtime error: failed to load 'sap/ui/thirdparty/jquery-mobile-custom.js' from resources/sap/ui/thirdparty/jquery-mobile-custom.js: ReferenceError: 'MSApp' is undefined

  • Hi Daniel,


    i am creating a project using command line tool then importing in the android  IDE. but i am getting error like Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. after changing compiler to 1.6 i am still facing error like

    /demo/gen already exists but is not a source folder. Convert to a source folder or rename it.


    i tried all possible option but don't know how to resolve it.



  • hi,

    while i am trying to install the SAP HAT using the kapsel SDK  , i am gettin the error as below . It is saying "config" file is not specified and while adding plugins toolbar is not available .But when i checked in the respective file location both the files exists.



    The build script exited unexpectedly!


    No config file specified. Searching for config.json in the current directory. Config file found at c:\SAP_HAT\WebIdeCompanion\companionapp/config.json. platforms: android Creating WebIdeCompanion project. Creating a new cordova project with name "WebIdeCompanion" and id "" at location "c:\SAP_HAT\WebIdeCompanion\companionapp\CompanionApp" Using custom www assets from c:\SAP_HAT\WebIdeCompanion\companionapp\assets\www c:\SAP_HAT\WebIdeCompanion\companionapp\CompanionApp c:\SAP_HAT\WebIdeCompanion\companionapp Adding platforms... android Creating android project... Creating Cordova project for the Android platform: Path: platforms\android Package: Name: WebIdeCompanion Android target: android-19 Copying template files... Project successfully created. Adding CompanionApp plugins... Fetching plugin "..\plugins/toolbar" via plugin registry npm ERR! addLocal Could not install ..\plugins/toolbar Error: ENOENT, open 'c:\SAP_HAT\WebIdeCompanion\companionapp\plugins\toolbar\package.json' cmd error The node process of the build script exited with code 1.


    help please...

    • It would be best to post this question as a new discussion or perhaps at SAP Web IDE Hybrid App Toolkit Add-on


      This guide does not cover the Hybrid Application Toolkit.


      The one thing I would suggest though is to verify the version of the Mobile SDK being used.  I imagine that a version of the Hybrid Application Toolkit is designed to work with a certain version of the Mobile SDK.




      Dan van Leeuwen

  • This series of articles has proved to be invaluable in the actual implementation of the SAP Mobile Platform Kapsel solutions.  I definitely get more from this than from any of the documentation.  Thanks so much!