Skip to Content

In this blog, I will go through the most common issues users have encountered when building applications with Mobile development kit (MDK), part of SAP Cloud Platform mobile services.  Most of these issues are due to simple configuration mistakes, typos, incorrect authentication, etc.  These issues can usually be resolved easily without filing an incident and I’m hoping this blog will help you do that.

If this is your first introduction to the mobile development kit, I suggest you first review content that provides a great introduction to the feature before proceeding with this blog.

Note: The feature name has recently changed from SAP Enterprise App Modeler to mobile development kit. You may see the previous name in the product and/or other content.

 

This is a living blog.  As I find more tips that are helpful, I will update this blog and share info to troubleshoot your applications.  I have not captured all of the possible errors, but just the most common ones to date.  At the end of this blog, I provide generic ways to troubleshoot different areas of the application.

The following issues are covered in this blog.

 

OData Initialization Failed message from client

This message is received when viewing the application in the mobile development kit client.  The mobile development kit client can be either the app on the device or in the simulator. The exact failure message received is based on the message you provided when creating the OData Initialization Failure message action.  This means that the OData Offline Initializes Action has failed to download the data needed to run the application.  This is often caused by a connection failure to the data.

Here are places you need to check to resolve this issue

Mobile development kit Editor in Web IDE

Look at the services connection. Open the file under the Services folder and click on Refresh Object.  If this fails, then this is most likely the cause of the problem and needs to be resolved.

 

Check the information entered in the Service Editor

  • Service URL: this service destination path comes from SAP Cloud Platform Cockpit. You can view your destinations by click on the following in SAP Web IDE: Tools -> SAP Cloud Platform Cockpit

 

 

Click on Destinations. You should see your destination to Mobile Services here. This is how SAP Web IDE connects to Mobile Services.

 

You can click on the destination name and view the configuration details. Make sure the destination was setup properly.  You can view the SAP HANA Academy – Mobile Development Kit: Setup Environment video to verify settings.

 

  • Application ID: this is the ID from Mobile Services. You can find this ID by going to Mobile Service for Development and Operations -> Mobile Applications -> Native/Hybrid -> <App Name>

 

 

  • Destination Name: this is the connection to the backend data available from within Mobile Services. You can find this name by going to Mobile Service for Development and Operations -> Mobile Applications -> Native/Hybrid -> <App Name> -> Connectivity

 

Verify the destination name is correct and you receive a successful Ping from this destination. You will also want to click on the destination and verify that your username / password to connect to Mobile Services is valid.

 

Note: if your password has recently changed, you need to update it here.  Click on the pencil icon to edit the destination and then click Next until you get to the User Name / Password screen.  Update the information.

 

Mobile development kit Client

If the Refresh Objects test succeeds, then let’s move on to other areas to evaluate.  The mobile development kit client also must properly authenticate to SAP Cloud Platform to download the data.  You may want to try the following:

  • Kill the app in the simulator or device and restart the application. This will force the application to re-authenticate with SAP Cloud Platform.

 

Application loads successfully, but screen is blank

You have created a page for your application and added data, but when you deploy your application to Mobile Services and then to the mobile development kit client, you get a blank page instead of the data you expect.  Here are few areas to check.

  • Turn on OData debugging in the client. Follow the instructions in the General Troubleshooting section of this blog
  • For Offline OData, check that the client database downloaded. View this blog for more information
  • Check that the target for the page has been set. If you create a page in the Editor such as a Product List page and you forgot to set a target for that control, you will receive a blank page even if you have set properties elsewhere for that control. In the screenshot below, the Target for the Product list is mapped to the Products collection.

 

 

  • Check BrandedSettings.json file. Make sure there are no smart quotes, typos, errors in the file

Another reason your screen may be blank is that you recently created a rule in the editor that the client is unable to parse properly.  Turn on client logging for more information or remove your newly created rule from the application to see if that solves your problem.

To turn on client logging, view that section under General Troubleshooting.

 

OAuth information blank in Mobile Services

You are following the steps from the SAP HANA Academy tutorials for Mobile development kit.  You get to the step where you create your “App Modeler” app in Mobile Services and then you click on Security and switch the Authentication from SAML to OAuth.  The video shows that the OAuth information is immediately published in the table on that page, but your screen has no data in the table.  If you click on the + icon for that table – everything there is blank too.  What gives?

There is an easy fix for this.  It looks like there was recently a minor change in Mobile Services.  Click on the Save button and you should now see that information populated for you.  You can continue with building your application.

 

 

TNS run command fails

In order to start the application, you need to do a  tns run command in the terminal.  If your tns run command fails, often this is due to having more than one Xcode version installed and/or you are not using the correct version for the mobile development kit.  Here, you have different options based on your situation.

  • If you are using tns run command to simply run your mobile development kit client, use the xcode-select command in terminal to choose the latest version of xcode 9.x to use and this would work fine.
  • If you are using the tns run command to developer custom extension contronsl, you must use the same Xcode version as what the MDK client was built with. So, for MDK 2.0.1, Xcode 9.0.1 should be used. If both versions of Xcode are installed,
    • Use the xcode-select command in terminal to choose the version of Xcode to use for the mobile development kit client
    • Run the application via Xcode directly. This is generally the easiest thing to do as you are using Xcode to develop in SWIFT anyway.

 

404 error in SAP Web IDE when creating the service for the application

When you create the service for the application, SAP Web IDE will make a connection to SAP Cloud Platform mobile services and attempt to contact the destination you specified.  If you receive a 404 error in SAP Web IDE, you may want to check the following:

  • Check the destination in the SAP Cloud Platform Cockpit and make sure it is setup properly
  • Check that the cross domain access is setup in Mobile Services

The easiest way to get to destinations is from SAP Web IDE.  SAP Web IDE: Tools -> SAP Cloud Platform Cockpit

Error: Can’t get data from App Update

If you receive an error from the client logs that it cannot get data from App Update in Mobile Services, this is most likely due to an invalid application type.

Go to Mobile Service for Development and Operations -> Mobile Applications -> Native/Hybrid and click on your application.  Then click on App Update.  Under Application Version, you should see App Modeler under the Type column.

If the application is not an App Modeler application, you will need to recreate the application in Mobile Services and setup the application for the mobile development kit again.

 

The mobile development kit Client fails to start & BrandedSettings.json not found in the terminal log

When starting the mobile development kit client from the simulator, it uses the BrandedSettings.json file to make a connection to SAP Cloud Platform mobile services and a specific application.  Here are some common issues encountered from entering information in the BrandedSettings.json file

  • Check the BrandedSettings.json for smart quotes, typos, missing commas, etc.
  • Check that there is a BrandedSettings.json file in <MDK Client>/<app name>/branding.
  • Here is an example of a properly working BrandedSettings.json file

 

 

LoggerManager has not been initialized yet!

You may receive this message in the client log during or after initialization of Offline OData.  This can be caused by having something specified in “Log Success”, “Log Invalid” or “Log Failure” of the Initialize Offline OData action.  A client limitation prevents this from working in some situations.  If you accidentally entered your success and/or failure message in one of these fields instead of the Success Action and Failure Action fields, that may be causing the problem.  The Solution is to remove these messages from the action.

 

 

General Troubleshooting Tips

If you have not received one of the issues listed above or you have tried the resolution tips listed above and you are still having issues, here are some general troubleshooting tips that can help any situation.

 

Turn on logging from the client
This is for the simulator only in mobile development kit 2.0.  You can turn on logging at the client level and get more specific detailed information about what errors and/or issues the client is running into when trying to run the application.

  • Turn on OData logging in the client. This can be done in the BrandedSettings.json file
  • You can also turn on general client logging from another terminal window.
    • Open a terminal session and run log command to stream log and filter for your application

log stream –level debug –predicate ‘senderImagePath contains “mdkclient” –style syslog

Where “mdkclient” is the name of the application used when creating the app via ./install.sh

  • “Mine” the actions and other objects with logging statements
    • Beware that the logger needs to be initialized first

 

 

Turn on logging at the Mobile Services level related to OData
Sometimes the OData errors are in the Mobile Services layer.  This logging can help you verify that or rule that out as a problem.

 

Places to check when encountering OData issues

  • Can you connect from Mobile Services? Do a test from Connectivity in Mobile Services
  • Check your Mobile Services destination
    • If you go to create a new service for your mobile development kit application and the service destination is empty then something is wrong with the destination.
    • You can view your destinations by click on the following in SAP Web IDE -> Tools -> SAP Cloud Platform Cockpit.
    • You can click on the destination name and view the configuration details. Make sure the destination was setup properly. You can view the SAP HANA Academy – Mobile Development Kit: Setup Environment video to verify settings.
  • Check that the Offline Store was downloaded. View this blog for more details.
  • Ensure the OData connection works from the backend.
    • Run the OData command inside the backend system using transaction /IWFND/GW_CLIENT
  • Check the SAP Cloud Connector to verify the OData service is properly exposed

 

General Rule troubleshooting
If you or the client is having issues with mobile development kit rules, you have a few options to troubleshoot your rule.

  • Add breakpoints to your rule in the Editor
  • You can debug your rule through the NativeScript debugger. This is done by running Node in debug mode.
  • Connect the Visual Studio code debugger for more rule debugging
To report this post you need to login first.

12 Comments

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

  1. Michael Healey

    Dear Sue

     

    On occasion there is another issue I experience from time to time. When I try and deploy an application from WebIDE FullStack to SCP Mobile Services I get the following error message:

     

    Build of SEAMWebpackFactory failed. Could not start the build because there is no builder installed
    . Please contact SAP support.

     

    So far this has been resolved by waiting a couple of hours and trying again. Is there a way to see when builder may not be available? I assume this is caused by maintenance on the SCP tenant hosting the WebIDE?

     

    Thanks

     

    Mike

    (0) 
    1. Sue Berry Post author

      Hi Mike,

      Thanks for the comment.

      I am on trial and I have seen this as well.

      Are you using a trial account or your own mobile services account?  It is the first thing Web IDE will ask me when I mention the issue.

      From my understanding, when the WEb IDE builder service goes down, they restart it and this sometime take time.  I’ll check with the web IDE team to see if there is a dashboard to view issues like this.  If I find out something useful, I’ll update the blog.

      (0) 
  2. Markus Reich

    Hi,

     

    I’m playing around with the MDK, could it be possible that the data changes are not transfered to the backend?

    I can edit fields on the client, but nothing is transfered to the backend?

     

    By the way I followed the tutorial on the SAP HANA Academy

     

    regards

    Markus

    (0) 
    1. Sue Berry Post author

      You need to make sure that you add an upload action for Offline OData into your application.

      I thought that was added to the Edit video for the Academy Tutorials, but I will check.

       

      Sue

      (0) 
  3. Sarbjeet Singh

    Thanks for summing up all these points. Is there any tutorial for logs configuration in mobile services. I am getting error while trying to fetch data via cloud connector.

    I wanted to debug the odata in the client but current installer present in the sap store seems to be corrupt.

     

    (0) 
    1. Sarbjeet Singh

      After debugging in the simulator client, I am getting below error.  Any pointer on this will be really helpful.

      CONSOLE ERROR file:///app/utils/Logger.js:53:24: [error] MDKClientLogger – Action – Error running action propagating error /workorder/Actions/offlineOdataInitialization.action: Error: [-10210] The operation failed due to an error on the server: -857 (SERVER_SYNCHRONIZATION_ERROR) ([-10225] Message: User exception: [-100000] An unexpected error occurred while converting the OData metadata to the Offline OData client database metadata: An exception occurred.

      (0) 
      1. Sue Berry Post author

        Hi Sarbjeet,

         

        I haven’t seen this error before, but it seems like something wrong with the Offline OData intialize action.  Maybe attach a screenshot of that action with the common action properties expanded.  Also – are you doing this with the sample service from Mobile Services or using your own OData Service?

        Thanks,

        Sue

        (1) 
        1. Sarbjeet Singh

          Hi Sue,

           

          Thanks for the reply. I am using my own oData service from local system.

          I was able to resolve the error finally by printing the traces in the xcode project and digging deep.

          Apparently, there was some error while creating the offline store based on $metadata structure. It was evaluating the metadata against EDMX standard and was failing.. After correcting the highlighted issue, it is working fine.

           

          However, there are many other things coming up now.. Like UI of custom client has some weird space on the top of the list.  I will try to check and then raise a question in the forums.

           

          Regards,

          Sarbjeet Singh

          (0) 
          1. Sue Berry Post author

            Hi Sarbjeet,

             

            I’m happy to hear you got past that error.

            I’m reviewing it so I can put it in this troubleshooting blog to help anyone else that might run into something similar.  If I have additional questions about your issue, I’ll let you know.

            Please let us know of your successes and/or issues with building your application. It is nice to see people on the SAP Community working with Mobile Development Kit.

             

            Sue

            (0) 
  4. Sarbjeet Singh

    Also, There is a way to test entity data in mobile services portal for a destination in an application.

    I found it quite helpful in debugging an issue.

    Click on the first icon in the Actions Column brings the following screen.

     

    Here the tests can be performed for the desired entitysets.

    Regards,

    Sarbjeet Singh

     

    (0) 
  5. Leonardo Gomez

    Hi Sue,

    I built the client like in this video
    https://www.youtube.com/watch?v=9r35mLLXON0&index=4&list=PLkzo92owKnVzN85sWfSdmwSOqlOAFE9DO

    After running this command
    tns run ios –emulator
    The emulator opens and the client is installed. It opens with a completely white screen, for a few seconds and then it’s closed without any message.
    In the console I can see the following errors.
    [AssetManager:79565] SyscallError: setpriority(PRIO_DARWIN_ROLE, 79565, 3): No such process
    SyscallError: MEMORYSTATUS_CMD_SET_PROCESS_IS_MANAGED failed for AssetManager:79565
    Do you have any suggestion on where to look? The name of my app is AssetManager.

    Kind regards,
    Leonardo.

    (0) 
    1. Leonardo Gomez

      ​Hi,

      I solved it, the issue is Xcode 10, it’s not compatible with the MDK client SDK. I downgraded it to Xcode 9.3.1 and it works (maybe 9.4 works too, but I see the blogs and tutorials are done with 9.3).

      Leonardo.

      (0) 

Leave a Reply