Troubleshooting¶
Troubleshooting is essential for diagnosing and resolving issues to ensure smooth and efficient operation. These issues may include application performance, connectivity problems, data syncing errors, user authentication and authorization issues, integration problems with backend systems, deployment challenges, and more.
Below are various ways you can troubleshoot these issues:
Mobile Development Kit Client Logs¶
By default, Mobile Development Kit app templates in the SAP Business Application Studio include logging and tracing options in their metadata. While running the app using the template on the Mobile Development Kit client, there are a few options under the User Menu on the main page that are helpful in capturing, logging, and tracing information.
Logging and Tracing Information¶
About¶
- Displays information about the user, device, app metadata version, and the
MDKClient
version. - While creating a support ticket, the Application Metadata Version and the Client Support Version (as described below) must be included:
- iOS:
SAPMDC
version - Android: Mobile Development Kit Client Version
- Web:
WebClient
Version
- iOS:
Support¶
The activity log area is enabled by default. There are different log levels, ranging from the least amount of log information to the most, like - Error, Warning, Info, Debug and Trace. Depending on the selected log level, log information is captured in the log file stored on the device. The Trace log level captures additional information about the events such as binding, odata, profiling and more. It also offers the OData Tracing option that captures information such as OData calls. See the MDK Tracing Categories section for more details on tracing output.
Accessing Client Logs¶
Extracting From Device¶
Mobile Development Kit client log files will be stored locally on the device.
- Android: Log files are stored within the application’s sandbox, and can be exported through the device’s settings. Settings > <
your_MDK_client_app
> Additional Settings (options might vary depending on the device's manufacturer) > Download Logs. You can download this file locally on the device and send it to the admin via email. - iOS: Log files are stored in the app’s document folder and can be copied from the device using iTunes (Windows) or Finder (Mac).
Upload to Mobile Services¶
Apps generated via Mobile Development Kit app templates have an option to send the activity logs to the support team. To do so, navigate to Support > Activity Log page where the users can upload the client log files to SAP Mobile Services. Ensure that the Log Upload setting is enabled in the app configuration on SAP Mobile Services before sending the activity log. For more details, see this tutorial. Admin or the support team can then view the error logs or download the uploaded log files to troubleshoot the issues.
Mobile Development Kit Tracing Categories¶
- You can set the Mobile Development Kit tracing categories and enable tracing in your branded client by default. This relays the tracing information to the console logs based on the selected categories, which is helpful during the Mobile Development Kit app development phase. While running the client locally, you will find additional entries starting with
mdk.trace.<category>
in the console output when the app performs the related activity such as navigating to a page, calling OData action to retrieve information, doing any kind of transaction and so on. - Tracing output is also logged into the client log file if the log level is set to Trace. If the log level is any other value, the tracing output will only be displayed in the console log. Use the term
- TRACE -
to search the tracing output in the client log file. No Output is the default tracing category name in the client log.
Network Trace¶
- In order to facilitate the inspection of messages sent between clients and other systems, SAP Mobile Services provides the Mobile Network Trace feature, which allows developers, supporters and administrators to capture the network traffic flowing between the app on the device and SAP Mobile Services as well as between SAP Mobile Services and the backend system.
- Refer to this SAP note to know how to enable network trace in SAP Mobile Services.
- After capturing the network trace, it can be downloaded from SAP Mobile Services and viewed locally using a text editor or an application that is compatible with
.har
files likeProxyman
, Chrome HTTP Archive Viewer, and other apps. - Customers can attach the network trace files to their support ticket for further investigation, if needed.
Cloud Connector/Backend Service Logs¶
While connecting to an on-premise system, you must check the cloud connector and backend service logs to identify the issues reported from these components. Refer to this SAP Note 2452568 for more information.
Inspecting the Offline Database Files¶
- While working with the offline data, especially during development, it is necessary to inspect the data downloaded from the backend systems into the offline database.
- By default, the offline databases are encrypted with user specific keys that are not accessible. So the offline databases cannot be opened.
- During the development phase in your branded client, you can set
SecureDatabaseEncryptionKey
property to false in theBrandedSettings.json
in your.mdkproject
. This will encrypt the offline database with a known key MDK. - The offline database files can be copied from the client and opened with the
ilodata
tool to inspect the content. Support team can also request copies of the database files in this configuration to assist with the investigation.- iOS: Offline files are stored in the app’s documents folder and can be copied from the device using iTunes (Windows) or Finder (Mac).
- Android: Offline files are stored in the app storage area in the files directory. If the device is configured for USB debugging, you can copy the files using Android Studio > Device Explorer and looking in storage > emulated > 0 > Android > data >
> files. While copying the files from the device, copy both the .udb
and.rq.udb
files.
- The
ilodata
tool will be included in the tools folder of Mobile Development Kit. For more information about the tool, refer to this document.
Debugging Your Mobile Development Kit Application¶
Using VSCode and the Mobile Development Kit extension for Visual Studio Code, you can debug your application rules by setting breakpoints in your rules to stop, inspect and step through the rule execution. For more details, refer to this tutorial.
Connectivity Status of the OData Service¶
- Verifying the security configurations of the destinations pointing to the OData Service in SAP Mobile Services is often the first step of troubleshooting. Refer to this document to learn how to test this using a browser.
- If the SAP Business Application Studio and SAP Mobile Services are not part of the same BTP subaccount, and you encounter an issue while connecting to an SSO based mobile destination, refer to this solution.
OData Service for Offline Use¶
SAP Mobile Services has introduced the OData Destination Quality Test feature for users to try and analyze the service. This feature checks for potential issues that could impact the service when used with Offline OData. Refer to this document for more information.
Passcode Configuration¶
- When the SAP Mobile Services application is configured with a Passcode Policy under Mobile Settings Exchange, the Lock timeout defaults to 0. This means that every time the app is brought back from the background, the user will be prompted to enter the passcode.
- When attaching a file or an image - whether by taking a new picture or selecting an existing image - you'll need to use an application outside the Mobile Development Kit client. So when the users head back to the Mobile Development Kit application after choosing the file, the lock timeout value will apply.
- To reduce the frequency of passcode prompts, you can set the lock timeout to 120 seconds or longer. This allows users to be away from the application for a longer period before being prompted for a passcode again.
Issues Encountered While Creating an Mobile Development Kit Branded Client¶
- Missing external references: Add external modules needed for the metadata project under the Externals property in the
MDKProject.json
under your.mdkproject
. - Metadata stored in a subfolder: Set the
BaseProject
property to the sub-directory name if the Mobile Development Kit project is not directly placed under the metadata folder in the.mdkproject
. -
Demo Mode is Not Working:
- Add
demo.js
and demo database files (.udb
and.rq.udb
) for offline OData in the demo folder under your.mdkproject
. For more information, refer to this document. -
Add the Demo section in the
BrandedSettings.json
file under your.mdkproject
.Note
If your demo app needs different connection settings when the client launches in the demo mode, add them under the Demo section. If you launch the demo mode without adding a connection setting, it falls back to the live settings. This step is mandatory if your demo offline database is generated with different server endpoint.
- Add
-
No option to scan the on-boarding QR code: Build your Mobile Development Kit client by setting the
EnableOverrides
property to true under.mdkproject
>BrandedSettings.json
>ConnectionSettings
. For more information, refer to this document. - Network error while onboarding:
- Review the connection settings in the
.mdkproject
if you have branded your client using Mobile Development Kit. - Check the client logs.
- Check if the device or simulator running the Mobile Development Kit client is connected to the internet.
- Review the connection settings in the
Issues Encountered While Deploying Mobile Development Kit Metadata Project¶
- Missing external references: You may encounter errors such as
Module not found: Error: Can't resolve '@nativescript/geolocation’
. This indicates that these modules are referenced in your Mobile Development Kit metadata project. In which case, you must explicitly list the referenced modules as external references. Go to SAP Business Application Studio and navigate to Settings > Switch to Remote > Search with MDK > Edit in Settings.json and include the module references inmdk.bundlerExternals
.
"mdk.bundlerExternals": ["@nativescript/geolocation"]
- Syntax errors (typos): Perform metadata validation in the Mobile Development Kit editor by either right-clicking on
Application.app
and choosing MDK: Validate Application or using the command palette. Check logs in the OUTPUT panel for additional details. - Unknown files included: Mobile Development Kit metadata projects can only contain files with certain extension types. Refer to Mobile Development Kit app components for more information. If files of other extension types are present in the metadata project, please remove them before deployment.
Asking For Help¶
You can post your questions on SAP Community and tag them with the text mobile development kit client to receive expert assistance.
Reporting a Problem¶
- Even after thorough troubleshooting and debugging, the issues might remain unresolved. In such cases, you must open a support ticket.
- When opening a support ticket, review the SAP Note 3110460 and provide the necessary files and information to aid the support team in investigating your issue further.
- If you are unable to attach/provide access to your application, we recommend creating a simple application to reproduce the problem. You can create the app using the Mobile Sample OData ESPM service that is available by default in SAP Mobile Services. This will simplify and accelerate the investigation. It will also help us confirm that the problem is an Mobile Development Kit related issue and not something specific to your application/coding.