Troubleshooting iOS App Hang with Vital Mobile SDK

Last updated: January 16, 2025

If you're experiencing issues with your app crashing or hanging when using the Vital SDK, follow these steps to help troubleshoot your issue.

Steps to Gather Information

  1. Ensure you're using the latest versions of the Vital SDK packages.

  2. Follow these steps to gather debug information:

    1. Run your app using the Xcode workspace.

    2. When the app enters the hang state, press "Pause program execution" on the debugger toolbar.

    3. Clear the output console.

    4. Type bt all in the console to print backtraces/stacktrace of all threads.

    5. Copy the backtraces/stacktrace to a text file.

Additional Information to Provide

  • Your Vital Team ID

  • The User ID being used

  • iOS version the app is running on

  • CPU usage pattern as reported by Xcode after the app enters the hang state (e.g., spinning at 100% or stuck at low usage)

One Potential Cause: HealthKit Data Store Corruption

You can inspect the backtrace/stacktrace yourself.

Glance through the stack frames of all the threads. If they are stuck on an Apple Health API symbol, this likely indicates a rare HealthKit data store corruption issue at the OS level.

Common symbols:

  • [HKHealthStore authorizationStatusForType:]

Verification

To further verify if this corruption issue is applicable to your iPhone:

  1. Open first-party apps like the Health app and the Fitness app

  2. Try to navigate around different sections of these apps

  3. If these apps also hang or become unresponsive, it confirms the OS-level issue

Resolution

Unfortunately, there is no known software-based mitigation for this OS-level issue. The only suggestion we can make is a hard reset of the device ("Erase All Content And Settings") & not restoring from a backup.