Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Summary
This article helps you resolve WebView reset problems in the Dynamics 365 Field Service mobile app. A WebView reset occurs if the mobile operating system stops an app process that uses too much memory. Common symptoms include the home screen appearing unexpectedly, file or PDF attachments closing immediately after they open, or the app crashing on Android devices. The problem is usually caused by memory spikes from large files or custom controls, or memory leaks from incorrectly managed JavaScript in model-driven apps.
Symptoms
When you use the Field Service mobile app, you experience one or more of the following symptoms:
The app unexpectedly returns to the home screen without warning.
A file or PDF attachment opens briefly and immediately closes.
The following error message appears:
WebView reset.
On Android, the app stops responding instead of showing an error message.
These symptoms might occur when you open large files, go to forms that have complex customizations, or use the app for a long time.
Cause
A WebView reset occurs when the mobile operating system ends an app process that exceeds its memory limits. The Field Service mobile app runs as a web application inside a WebView on the mobile client and is subject to the operating system's memory management policies. The memory threshold varies by device and operating system, so you might not always be able to reproduce the issue.
The behavior differs by platform:
- iOS: WebViews run in separate processes that the operating system can terminate independently from the main app. If the WebView process exceeds the memory threshold, the operating system ends it. The app detects this condition, restarts the WebView, and shows the "WebView reset" error.
- Android: The WebView runs within the main app process. If memory limits are exceeded, the entire app crashes.
- Desktop browsers: WebView resets don't occur, but you can still investigate memory pressure by using browser tools.
Two types of memory problems typically cause WebView resets:
Memory spike
A memory spike is a sudden increase in memory usage caused by allocating a large object. Common causes include:
- Storing Base64-encoded images or videos in variables within Power Apps component framework (PCF) controls or web resources.
- Using JavaScript libraries that import large resource files, like font libraries.
If you can reliably reproduce a WebView reset by performing a specific action like opening a form or control, a memory spike is likely the cause.
Memory leak
A memory leak occurs when allocated memory isn't released because of lingering references, such as event listeners or objects that aren't properly cleaned up. This problem prevents the garbage collector from reclaiming the memory, so usage gradually increases over time.
For example, a leak can occur if you add event listeners to the JavaScript window object without removing them when you navigate away from a page. If WebView resets occur randomly and aren't tied to a specific action, a memory leak is the likely cause.
Solution
For users
If the WebView reset occurs when you open a PDF or file attachment on a work order, try the following steps:
- Reduce the file size. Attachments tha are larger than 10 MB are more likely to trigger a WebView reset. Ask the sender to compress or resave the file at a lower resolution before they reattach it to the work order.
- If the issue occurs consistently by using the same file, try to open the file on a different device or in a desktop browser to check whether the file is corrupted.
- Free up memory by closing other apps that are running on the device. Then, restart the Field Service app, and try again to open the attachment.
For administrators
Review any custom controls or web resources that were added to the mobile app. Custom controls that store Base64-encoded images or import large JavaScript libraries can cause memory pressure and more frequent WebView resets.
For iOS, use Safari memory analysis tools to check the memory performance of your iOS app. For more information, see the Timelines tab in Web Inspector.
Use browser developer tools such as Microsoft Edge DevTools to track memory usage and find issues. Code that causes memory pressure on mobile apps also causes memory pressure on desktop browsers. For more information, see Fix memory problems in Microsoft Edge DevTools.
To find problematic scripts or customizations, debug JavaScript code for model-driven apps.