SAP Web IDE is a browser based IDE for developing SAPUI5 based applications. It lets you to rapidly design, build and deploy Fiori like apps based on SAPUI5. droid@screen-1.pngWeb IDE started supporting development of hybrid applications, the hybrid apps are based on Cordova framework. So you are free to add any Cordova plugins to your SAPUI5 project to access the native features of the phone in few clicks. In this UI5 based mobile app example I am accessing camera of my phone.

Prerequisites

Java Development Kit (JDK)

Apache Ant 1.8 or later

Android SDK – Set system environment variable ANDROID_HOME to the location SDK. Add Android tools (C:\adt-bundle-windows-x86_64-20140702\sdk\tools) and platform-tools to your path.

Node.js

Cordova – Recommended version is 3.6.3-0.2.13

Git

Hybrid App Toolkit Add-on

SMP 3 SP05 SDK

Verify Hybrid App Development Environment

To verify the development environment extract Hybrid App Toolkit Add-on and open the hybridapptoolkit.communicator-1.0.0\installation folder and run check_env.bat.

ScreenHunter_12 Dec. 15 11.52.jpg

Setting up Hybrid Toolkit Communicator

Hybrid Toolkit Communicator invokes the Hybrid App toolkit from Web IDE over HTTPS.

Navigate to the folder ..hybridapptoolkit.communicator-1.0.0/installation, right click setup.bat and Run as Administrator.

In this step you are prompted for your Web IDE host URL and set a keystore password.

ScreenHunter_13 Dec. 15 11.59.jpg

Next, open the hybridapptoolkit.communicator-1.0.0 folder and start Hybrid App Communicator by double clicking run.bat.

ScreenHunter_16 Dec. 15 16.18.jpg

Build Hybrid Companion Container App

The companion app is used to preview the hybrid app developed using Web IDE.

To build companion app, open command promt, change path to ..hybridapptoolkit.communicator-1.0.0\WebIdeCompanion\companionapp and run the command npm install.

Edit config.json file present in the folder ..hybridapptoolkit.communicator-1.0.0\WebIdeCompanion\companionapp as given below.

pluginDir refers to the SMP SDK installation path.

ScreenHunter_13 Dec. 15 12.51.jpg

Then, run command:

node create_companion_app.js

ScreenHunter_16 Dec. 16 19.53.jpg

Create Hybrid Project

From Web IDE, to enable external plugin: Select Tools > External Plugins > com.sap.webide.hybrid.

Refresh Web IDE, then create a Mobile Kapsel Project and replace the index.html with index.html.

ScreenHunter_16 Dec. 16 18.36.jpg

Configure Device and Run the App

To configure device right click on project> Project properties> Device configuration and choose a mobile platform, camera plugin and Save.

ScreenHunter_16 Dec. 16 18.53.jpg

To preview the app right click on the intex.html> Run > Preview on > Android device.

Happy Coding !

Midhun VP

To report this post you need to login first.

72 Comments

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

  1. Manuel Ramirez

    Here with this tool, even when it’s a hybrid app, we can access the camera. Can we access more hardware? or external devices like barcode scanners?

    Why using this and not AppBuilder, which was the previous SAP recommended for hybrid, can you make a brief explanation about main differences, and if the other product is deprecated or is still recommended?

    Regards.

    (0) 
    1. Michael Appleby

      Hi Manuel,

      AppBuilder is due to be deprecated as a result of Web IDE being released.  Not sure the date, but it is probably in the PAM somewhere.

      Cheers, Mike

      SAP Customer Experience Group – CEG

      (0) 
  2. Sonu Kumar

    Hi Manuel,

       I am getting an error when i run node create_companion_app.js .

       Adding SAP plugins…

       Installing “com.sap.mp.cordova.plugins.corelibs” for android

       Fetching plugin “C:\SAP\MobileSDK3\KapselSDK\plugins/apppreferences” via     plugin registry

       Error: ENOENT, stat ‘C:\SAP\MobileSDK3\KapselSDK\plugins\apppreferences’

    How to resolve this error ?

    Can you provide updated link for sdk 3.0 SP05 above link is not working any more ?

    (0) 
    1. jitendra kansal

      Sonu Kumar

      Can you check in the config.json file (\SAP_HAT_local-1.0.1\WebIdeCompanion\companionapp) if you have defined pluginDir as below:

      pluginDir”: “C:\\SAP\\MobileSDK3\\KapselSDK\\plugins”

      <<this path is for windows OS). Please check this guide for more info.

      Regards,

      JK

      (0) 
    2. Midhun VP Post author

      Hi Sonu,

      Make sure you given right path to the SMP installation in the config.json file. In the case of Windows you have to give double slash to the SMP path like C:\\SAP\\MobileSDK3\\KapselSDK\\plugins

      Regards, Midhun

      SAP Customer Experience Group – CEG

      (0) 
      1. Sonu Kumar

        Hi Manuel and JK 

        I have given right path but the problem is with SDK . SDK is 3.0 SP03 which doesn’t have this plugin .

        can you provide trial version of latest SDK link ?Above links are not working any more for downloading SDK  .

        (0) 
  3. Ted Castelijns

    Very nice blog! I do find it unfortunate that all software is trial except for the SDK. I spent all day yesterday trying to get the SDK downloaded but it does not show in service marketplace and the sap store link for Mac (which is SP03) does not work.

    I hope I will be able to download the SDK soon so I can start playing with all this stuff.

    (0) 
  4. Livio Lazzeri

    Hi.

    I am not able to build the Companion App. When I issue the npm install command I get the following warning:

    npm WARN package.json  create_companion_app@0.0.1 No repository field.

    If I ignore this warning and go ahead, when I issue the node create_companion_app.js I get the following error:

    sed: no such file or directory: platforms\android\src\com\sap\ide\companion\WebIdeCompanion.java

    Any help?

    Best regards.

    Livio

    (0) 
    1. Midhun VP Post author

      Hi Livio,

      Have you updated the file config.json with the kapsel plugin installation path before the command node create_companion_app.js. For a step by step procedure you can look at this guide.

      Regards, Midhun

      SAP Customer Experience Group – CEG

      (0) 
      1. Livio Lazzeri

        Hi Midhun,

        yes, I followed the step by step guide and I updated the config.json before issuing the command.

        From the error message, I really have no idea of what is going wrong.

        Any other suggestion?

        Regards,

        Livio.

        (0) 
        1. Midhun VP Post author

          Hi Livio,

          Could you give screen shots of the error.

          To make sure the prerequisites are installed correctly, could you try creating a basic cordova project with kapsel logon plugin or any other plugin by following this blog: Getting Started with Kapsel – Part 2 — Logon    

          You don’t need to run the app but see whether the cordova commands are executed without any errors.


          Also double check the path to your kapsel sdk,

          In the case of Windows you have to give double slash to the SMP path like C:\\SAP\\MobileSDK3\\KapselSDK\\plugins

          Regards, Midhun

          SAP Customer Experience Group – CEG

          (0) 
          1. Livio Lazzeri

            Hi Midhun,

            I solved the problem, finally.

            The recommended Cordova version is 3.6.3 but I already had a Cordova 4.1.2 installed so I decided not to downgrade it. Unfortunally 4.1.2 has a documented bug: it ignores the provided appName and always uses the default name CordovaApp.

            As a circumvention, in the config.json file I changed the value of the appName parameter to CordovaApp and the build process completed successfully.

            Regards,

            Livio

            (0) 
  5. Sonu Kumar

    Hi , Midhun

    Thanks for writing such a nice blog .

    can you add some links (video or blogs or docs e.t.c.) which teach how to build app using cloud database .

    My requirements :

    My app would like to connect to SAP cloud database to fetch and push data .Data is generated based on user requirements or feed. I would like to create my own tables based on my requirements. I would like query those tables.

    (0) 
      1. Sonu Kumar

        Hi Midhun ,

        The link you provided for Youtube channel includes old technology.Videos are 1-3 yr old , 3 videos are new but they are not useful . I would like to use SDK05 with patch 5 . I am having hard time with SAP infrastructure . Like other technology i am unable to find useful resources .

        (0) 
        1. Midhun VP Post author

          Hi Sonu,

          If you have a specific question or facing any issues you can raise it as a new discussion within SCN. You can find the documentation of SMP in help.sap.com.

          Regards, Midhun

          SAP Customer Experience Group – CEG

          (0) 
            1. Midhun VP Post author

              Hi Sonu,

              There is no guarantee that all of the questions raised in SCN would be answered. Because SCN is not the official support portal of SAP. SCN is like a social network for SAP professionals. People contribute here during their free time out of passion towards technologies.

              When you need immediate support on an issue please raise in the official support portal, Home | SAP Support Portal .

              Regards, Midhun

              SAP Customer Experience Group – CEG

              (0) 
  6. Klaus Enders

    Hi Midhun,

    thanks for sharing this tutorial. I was able to run the example as expected on an Android device. I have some further questions.

    1. The companion app is still a local cordova container App, which needs a lot of installed components to enable the testing. As the WebIDE is a central cloudbased environment I just wonder whether the “SAP WebIDE Hybrid App Toolkit Add-on” could be a central cloudbased environment embedded in the WebIDE, too.

    2. I am not able to deploy the Kapsel App on my trial account. The menu action “deploy –> deploy to SAP Hana Cloud” is not active…

    Regards

    Klaus

    (0) 
    1. Midhun VP Post author

      Hi Klaus,

      1. I don’t know the possibility of taking the SAP WebIDE hybrid app toolkit to cloud.

      2. These are hybrid apps, so there is no need to host these apps in a server to access it. You have to create an executable file for mobile devices from this project (ex. apk file in the case of Android).

      Regards, Midhun

      SAP Customer Experience Group – CEG

      (0) 
      1. Matthias Hubert

        Hello Midhun,

        you mentioned (in response to Klaus Enders) that if you want to deploy the app on an

        android device you have to create an executable file (.apk file) for the android device.

        Is there a tutorial or documentation available which explains how to create an executable file (.apk file) from a web-ide project?

        Best regards,

        Matthias

        (0) 
        1. Midhun VP Post author

          Hi Matthias,

          You should find the apk file in the below path after running the project: C:\Users\Administrator\SAPHybrid\Products\hybrid\platforms\android\build\outputs\apk\android-release.apk , where Products is my project name.

          Regards, Midhun

          SAP Technology RIG

          (0) 
  7. Devraj Singh

    Hi Midhun,

    Thanks for the wonderful blog, I was following your blog till

    Create Hybrid Project

    From Web IDE, create a Mobile Kapsel Project

    But I could not able to find any option available in WebIDE for Create a Mobile Kapsel Project, When I had created a sample project then I could not able to find any Device settings as mentioned above.

    Pls suggest.

    Regards

    Devraj

    /wp-content/uploads/2015/01/sdn_633524.png

    (0) 
    1. Midhun VP Post author

      Hi Devraj,

      You have to include external plugin to Web IDE to start developing hybrid apps, From Web IDE, to enable external plugin: Select Tools > External Plugins > com.sap.webide.hybrid. Then refresh Web IDE to load the plugins.

      Regards, Midhun

      SAP Technology RIG

      (0) 
  8. Klaus Enders

    Hi Midhun,

    after following your advice to enable the com.sap.webide.hybrid plugin the Kapsel templates are available again.

    However, is it possible to start the development with a Fiori template and as soon as hybrid capabilities are needed to switch to an hybrid app that is hosting the “initial fiori app” (without copy the code to a new app).

    Best regards,

    Klaus

    (0) 
    1. Midhun VP Post author

      Hi Klaus,

      If your requirement is to get the Fiori look for your hybrid app you can use the template SAPUI5 master detail kapsel application.

      ScreenHunter_36 Feb. 17 16.28.jpg

      And i don’t know why Fiori Master detail template doesn’t have device configuration settings. May be Oliver Graeff could give more info on that.

      Regards, Midhun

      SAP Technology RIG

      (0) 
      1. Uri Nizan

        Device configuration settings are only available in templates that are designed for mobile (i.e. with Kapsel built in).

        These include the HAT templates (with Kapsel in the name) and the Master Detail with Photos template.

        (0) 
  9. Klaus Enders

    Thanks a lot Midhun,

    I saw that there is a new version of the HAT available. Which steps do I have to perform to upgrade to the version 1.1.0?

    Is it just download & unzip and run the setup.cmd again?

    Best regards,

    Klaus

    (0) 
      1. Klaus Enders

        Hi Matthias,

        I run the whole exercise with version HAT 1.0.1 and I was wondering how I can upgrade to the current HAT 1.1.0 in a simple manner. Am I got you right, I have run to the whole setup again 🙁

        (0) 
  10. Puneet Kumar Lajpal

    Hi Midhun,

    While trying to set up the Hybrid App Toolkit add-on 1.2.6, I can not get into the set up where Web IDE host URL and set a keystore password need to be entered. Could you guide if I am doing something wrong here.setup.JPG
    Thanks and Regards

    Puneet

    (0) 
  11. Venkata Jyothi Swaroop Chikkam

    Hi Midhun,

    Firstly thanks for your blogs and answers!

    I have installed the local version of IDE(1.8.4) and HAT(1.2.6). Created the same application as per your blog.

    But when running the preview mode on Android Device I am getting the error – ERROR: Failed to launch application on device: ERROR: Failed to install apk to device: ERROR: Failed to deploy to device, no devices found.


    I have connected my android device but still getting the above error.

    Can you please help on this?

    Thanks,

    Swaroop.

    (0) 
    1. Midhun VP Post author

      Hi Swaroop,

      To detect your android device you should enable “remote debugging” in your device. Also enable the option “install apps from unknown sources”. You would find these options in settings of your device.

      If you are using a Samsung device you may also need to install Samsung Kies in your machine (which would install required device specific drivers in your machine).

      Also, to do a preview you should do the steps to create a companion app (it is mentioned in the HAT installation guide). When you preview, the companion app will be first installed on device, then the app from web ide will be pushed to the companion app.

      Regards,Midhun

      SAP Technology RIG

      (0) 
      1. Venkata Jyothi Swaroop Chikkam

        Thank You Midhun!!! Its working now.

        One more question is, camera is not working on emulator(Error – Unfortunately camera has stopped). I have googled but not able to find any fix for this. Even changed AVD settings and no luck. Any idea on how to fix this?

        Thanks,

        Swaroop.

        (0) 
        1. Midhun VP Post author

          Hi Swaroop,

          This is specific to Android simulator. When you are creating a simulator you in the settings you have an option to use your laptop camera as the cam for your simulator. I haven’t tried it. I really don’t like to use simulator for development, because it’s slow.

          Regards, Midhun

          SAP Technology RIG

          (0) 
          1. Venkata Jyothi Swaroop Chikkam

            Hi Midhun,

            I have assigned the webcam in the drop down list of AVD for Front/Back Camera and even changed the permission settings of the webcam in my laptop.

            As the Preview on Android Device is working this is no important.

            I have installed Intel HAXM for the Emulator and is really fast in terms of loading(20 to 30 seconds) compared to ARM.

            Again thanks for you quick and helpful answers.

            Thanks,

            Swaroop.

            (0) 
  12. Saranya Sampath

    Hi ,

    I have completed the two steps 1. Check Hybrid Development Prerequisite 2. Install hybridAppToolKit .

    In the third step Build Hybrid Companion App I am facing below issue.Please find the error details below.How can we fix this  ? Please share your ideas.

    Installing “com.sap.mp.cordova.plugins.logon” for android Installing “com.sap.mp.cordova.plugins.authproxy” for android Fetching plugin “org.apache.cordova.device” via plugin registry Failed to install ‘com.sap.mp.cordova.plugins.authproxy’:Error: shasum check failed for \registry\_design\app\_rewrite\org.apache.cordova.device\-\org.apache.cordova.device-0.3.0.tgz Expected: 3113febea417dbcc25e81fbde5e2e3664b0721f7 Actual: 86951785b5801d036f5f0d41abc14abcc1bac2c2


    (node.js:419:13) Failed to install ‘com.sap.mp.cordova.plugins.logon’:Error: shasum check failed for C:\Users\SS\AppData\Local\Temp\npm-580-2hluHCVx\cordova.iriscouch.com\registry\_design\app\_rewrite\org.apache.cordova.device\-\org.apache.cordova.device-0.3.0.tgz Expected: 3113febea417dbcc25e81fbde5e2e3664b0721f7 Actual: 86951785b5801d036f5f0d41abc14abcc1bac2c2

    (0) 
      1. Saranya Sampath

        No. If we want to install SMP3 , Can we use trial version which is available in sap store ? And how long we can use this I mean validity of trial one.

        (0) 
        1. jitendra kansal

          Saranya Sampath

          you dont need any license to use SMP3 Mobile SDK available at SAP store. If you want to have SMP3 server, you have to download it from service marketplace (requires S-user credentials+license cost), you may take advantage of HANA cloud platform mobile services (trial version) to host your app.

          If you have any other queries not related to this blog, please raise a new thread.

          Regards,

          JK

          (0) 
    1. Midhun VP Post author

      Hi Saranya,

      You need SMP SDK to create companion app because companion app has a dependency with Kapsel SDK (part of SMP SDK).

      A trial version of SDK is available here. The trial has unlimited validity but you should’t use it for production. For production use, you need to buy the SDK.

      When you are installing SDK you should make sure you have compatible Cordova version. Have a look at the list below.

      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.

      Ref: http://scn.sap.com/docs/DOC-49592


      Regards,Midhun

      SAP Technology RIG

      (0) 
      1. Saranya Sampath

        Hi Midhun,

        Currently we are using SMP 3.0 SP04 server. And I have installed cordova 4.2.0 . Is SP08 SDK compatible with server version. Or Do we need to update it?

        With regards

        Saranya

        (0) 
  13. Seenu Katha

    Hi Midhun,

    I am trying to install HAT 1.5.2 which is the latest from download link.

    Strangely when I run setup.cmd C:\Seenu\SAP_HAT_local\SAP_HAT_local-1.5.2, it says

    ‘Run this batch file without administrator previleges’.

    Capture1.PNG

    Then I went ahead and run check_env file for windows, it said bower is not installed. It kept on failing to install bower.

    Capture2.PNG

    Then I manually installed bower. Pls see versions.

    Then I logged off and logged into another windows user without admin rights. When I execute setup.cmd, it keeps on failing on bower installation.

    Capture3.PNG

    pls see screen shots and help me where i am going wrong.

    Thanks

    seenu

    (0) 
      1. Seenu Katha

        JK,

        My system OS is Windows 2008 Server R2 64 bit.

        Yes I have admin rights

        I use this on Remote desktop. So I do Run..cmd..it works

        Yes I tried running cmd as admin.

        Pls let me know how to solve this.

        Thanks

        seenu

        (0) 
        1. Midhun VP Post author

          Hi Seenu,

          I have faced the same error in a remote server. I am not sure about the solution, I would request you to raise a support ticket on this. I have raised an internal ticket on this. If I get any other information I would update you.

          Regards,Midhun

          SAP Technology RIG

          (0) 
          1. Seenu Katha

            Hi Midhun,

            I edited setup.cmd file in folder SAP_HAT_local\SAP_HAT_local-1.5.2\setup

            to remove net sessions command and its error message to install HAT.

            It worked with this workaround.

            Thanks

            seenu

            (0) 
            1. Vishnupriya Varadharajan

              Hi Seenu,

              I am facing the same issue. Could you pls let me know as what command did you remove form the setup.cmd file.

              I am not able to open the setup.cmd when I tried to remove the netsession command.

              Thanks.

              (0) 
              1. Seenu Katha

                Hi Vishnupriya,

                I opened setup.cmd file using notepad from the foloder SAP_HAT_local\SAP_HAT_local-1.5.2\setup.

                Then I removed the line that checks for net session command and its errors.

                so the file will have the following..

                @setlocal enableextensions

                @echo off

                @cd /d “%~dp0”

                echo Validating installation prerequisites…

                call scripts\win\check_env.cmd

                @if errorlevel 1 (

                    goto END_ERR

                )

                echo y| cacls ..\config.json /p %USERDOMAIN%\%USERNAME%:c >nul 2>&1

                echo y| cacls ..\WebIdeCompanion\companionapp\config.json /p %USERDOMAIN%\%USERNAME%:c >nul 2>&1

                echo y| cacls ..\logs /t /p %USERDOMAIN%\%USERNAME%:f >nul 2>&1

                echo y| cacls ..\views /t /p %USERDOMAIN%\%USERNAME%:c >nul 2>&1

                echo y| cacls ..\*.js /p %USERDOMAIN%\%USERNAME%:c >nul 2>&1

                echo y| cacls ..\*.cmd /p %USERDOMAIN%\%USERNAME%:c >nul 2>&1

                echo y| cacls *.cmd /p %USERDOMAIN%\%USERNAME%:c >nul 2>&1

                echo y| cacls scripts\win\*.cmd /p %USERDOMAIN%\%USERNAME%:c >nul 2>&1

                echo y| cacls app\*.js /t /p %USERDOMAIN%\%USERNAME%:c >nul 2>&1

                echo y| cacls app\*.html /t /p %USERDOMAIN%\%USERNAME%:c >nul 2>&1

                echo y| cacls server\*.js /t /p %USERDOMAIN%\%USERNAME%:c >nul 2>&1

                echo y| cacls scripts\*.js /t /p %USERDOMAIN%\%USERNAME%:c >nul 2>&1

                echo —

                echo Installing required modules…

                call scripts\win\backend.cmd

                @if errorlevel 1 (

                    goto END_ERR

                )

                goto END

                :END_ERR

                pause

                :END

                @endlocal

                (0) 
                1. Vishnupriya Varadharajan

                  Hi Seenu,

                  Thanks. This is waht exactly even I did.

                  But when I did this change and tried to open the setup.cmd it is just opening for a few micro seconds and getting closed automatically. I am using 1.4.2 version.

                  Not sure what is the issue here.

                  Midhun VP any updates from SAP on this issue?

                  Thanks

                  Vishnupriya

                  (0) 
                  1. Seenu Katha

                    Hi Vishnupriya,

                    Later I changed the file check_env file in the folder

                    SAP_HAT_local\SAP_HAT_local-1.5.2\setup\scripts\win.

                    @setlocal

                    @echo off

                    set DIR_MAX_LEN=90

                    set #=%CD%

                    set length=0

                    :loop

                    if defined # (set #=%#:~1%&set /A length += 1&goto loop)

                    @if %length% gtr %DIR_MAX_LEN% (

                        echo.

                        echo The current path: “%CD%” is too long ^( %length% ^> %DIR_MAX_LEN% ^)!

                        echo echo Your install path exceeds Windows 260 character path length limit, so

                        echo npm and Cordova will not work as expected!

                        echo Please use a shorter install path. For example: d:\WebIDE\hat

                        goto END_ERR

                    )

                    rem This script is created to help to developer check all prerequisites for building Cordova apps.

                    rem We assume that most of the prerequisites are installed with the SMP3 SDK, or manually.

                    rem Please refer to the installation guide for more details.

                    echo Node.js version:

                    call node –version 2> nul

                    @if errorlevel 1 (

                        echo ERROR: Node.js cannot be found!

                        echo Install the node.js version 0.10.3x  ^(0.10.30 ^<^= ver ^< 0.11.0^) from: http://nodejs.org/dist/

                        echo After installation completes, you may need to restart your computer.

                        goto END_ERR

                    )

                    for /f “delims=v” %%i in (‘node –version’) do set nv=%%i

                    if %nv% lss 0.10.30 set nv_not_comp=true

                    if %nv% geq 0.11.00 set nv_not_comp=true

                    if “%nv_not_comp%”==”true” (

                        echo ERROR: The current Node version is not compatible ^(0.10.30 ^<^= ver ^< 0.11.0^)!

                        echo Install node.js verion 0.10.3x from: http://nodejs.org/dist/

                        echo After installation completes, you may need to restart your computer.

                        goto END_ERR

                    )

                    echo —

                    echo npm version:

                    call npm –version 2> nul

                    @if errorlevel 1 (

                        echo ERROR: npm cannot be found!

                        echo npm is packaged with the node.js installer. Install node.js from: http://nodejs.org/download/

                        goto END_ERR

                    )

                    echo —

                    echo git version:

                    call git –version 2> nul

                    @if errorlevel 1 (

                        echo ERROR: git cannot be found!

                        echo Please install it from http://git-scm.com/

                        goto END_ERR

                    )

                    set ERROR_LOG_FILE=%TEMP%\~errorlog.txt

                    :BOWER_INSTALL

                    echo —

                    echo bower version:

                    call bower –version 2> nul

                    goto END

                    @if “%errorlevel%”==”0” goto END

                    echo ERROR: bower cannot be found!

                    echo Please wait: we are now installing Bower…

                    call npm install -g bower >%ERROR_LOG_FILE% 2>&1

                    @if “%errorlevel%”==”0” goto BOWER_INSTALL

                    :CHECK_ERROR

                    findstr “ERR!” %ERROR_LOG_FILE% > nul 2>&1

                    @if “%errorlevel%”==”0” goto SET_PROXY

                    echo.

                    type %ERROR_LOG_FILE%

                    echo.

                    goto BOWER_INSTALL

                    :SET_PROXY

                    echo.

                    type %ERROR_LOG_FILE%

                    echo.

                    echo Bower installation issue encountered. You may need to configure the HTTP\(S\) proxy for npm \(To exit the installer, press enter\).

                    set /p h_proxy=Enter your proxy setting (e.g. https://proxy.company.com:8080):

                    @if “%h_proxy%”==”” goto END_ERR

                    call npm config set proxy %h_proxy%

                    call npm config set https-proxy %h_proxy%

                    call git config –global http.proxy %h_proxy%

                    call git config –global https.proxy %h_proxy%

                    goto BOWER_INSTALL

                    :END_ERR

                    echo.

                    echo Your environment is not ready for setup.

                    @endlocal

                    exit /b 1

                    :END

                    @endlocal

                    I do not think it is a good idea to edit these files that ensure correct versions.

                    But I had all the correct versions. Still these commands were not working correctly. So I changed them.

                    BTW, to see errors, we have to execute these files from cmd.

                    Thanks

                    seenu

                    (0) 
                  2. Midhun VP Post author

                    Hi Vishnupriya,

                    HAT setup doesn’t work if you logged into server as administrator or run the setup file as admin. You have 2 options to make it work.

                    1. Create a new user
                    2. Delete the script condition that checks admin privilege from the file setup.cmd (HAT/setup/setup.cmd). Delete the highlighted code given below.

                    /wp-content/uploads/2015/07/2015_07_20_15_29_14_751481.png

                    Regards,Midhun

                    SAP Technology RIG

                    (0) 
                    1. Vishnupriya Varadharajan

                      Thanks Midhun. I had tried the second option (Delete the script condition that checks admin privilege from the file setup.cmd )  and I was able to install.

                      But option 1 didnt work because in the process of installing HAT, a Server Certificate is getting generated and that requires Admin privileges!! which is contradictory. And hence that option didnt work.

                      Option 2 is fine.

                      Thanks again for your response.

                      Regards,

                      Vishnupriya

                      (0) 
  14. Saranya Sampath

    Hi Midhun,

    I have installed SMP SP08 sdk. and cordova version is 4.2.0. During build companion app step I am getting different error.

    Project successfully created.
    Adding SAP plugins…

    Installing “com.sap.mp.cordova.plugins.corelibs” for android
    Fetching plugin “C:\SAP\MobileSDK3\KapselSDK\plugins/apppreferences” via plugin registry
    npm WARN `git config –get remote.origin.url` returned wrong result (git://github.com/C:\SAP\MobileSDK3\KapselSDK\plugins/apppreferences)
    npm WARN `git config –get remote.origin.url` returned wrong result (git@github.com:C:\SAP\MobileSDK3\KapselSDK\plugins/apppreferences)
    npm ERR! git clone git@github.com:C:\SAP\MobileSDK3\KapselSDK\plugins/apppreferences Cloning into bare repository ‘C:\Users\userID \.plugman\cache\_git-remotes\git-github-com-C-SAP-MobileSDK3-KapselSDK-plugins-apppreferences-b9c20db0’…

    npm ERR! git clone git@github.com:C:\SAP\MobileSDK3\KapselSDK\plugins/apppreferences ssh: connect to host github.com port 22: Bad file number
    npm ERR! git clone git@github.com:C:\SAP\MobileSDK3\KapselSDK\plugins/apppreferences fatal: Could not read from remote repository.
    npm ERR! git clone git@github.com:C:\SAP\MobileSDK3\KapselSDK\plugins/apppreferences
    npm ERR! git clone git@github.com:C:\SAP\MobileSDK3\KapselSDK\plugins/apppreferences Please make sure you have the correct access rights
    npm ERR! git clone git@github.com:C:\SAP\MobileSDK3\KapselSDK\plugins/apppreferences and the repository exists.
    npm ERR! addLocal Could not install C:\SAP\MobileSDK3\KapselSDK\plugins/apppreferences
    Error: ENOENT, stat ‘C:\SAP\MobileSDK3\KapselSDK\plugins\apppreferences’
    cmd error
    The node process of the build script exited with code 1.
    What might be the issue? PLease help.

    With regards

    Saranya

    (0) 
  15. Matthias Hubert

    Hello Midhun,

    you mentioned (in response to Klaus Enders on Jan10, 2015 6:58AM see above) that if you want to deploy the app on an android device you have to create an executable file (.apk file) for the android device.

    Is there a tutorial or documentation available which explains how to create an executable file (.apk file) from a web-ide project?

    Best regards,

    Matthias

    (0) 

Leave a Reply