Skip to main content

Common Issues

Symptoms: The permission dialog doesn’t appear when calling requestAuthorization().Solutions:
  1. Ensure Health Connect is installed: Health Connect is pre-installed on Android 14+. On older versions, install it from the Google Play Store.
  2. Set Activity before requesting:
  3. Verify provider is set:
  4. Check min SDK: Your app’s minSdk must be 29 or higher.
  5. Check Health Connect package query: The SDK declares this in its manifest, but verify it merged correctly:
Symptoms: Samsung Health provider not found or setProvider("samsung") returns false.Solutions:
  1. Samsung devices only: Samsung Health SDK typically only works on Samsung devices.
  2. Samsung Health app must be installed: The user needs the Samsung Health app installed and set up.
  3. Try Health Connect instead: Health Connect works on all Android 10+ devices:
  4. Check available providers:
Symptoms: Data only syncs when the app is in the foreground.Solutions:
  1. Check battery optimization: Many Android manufacturers (Samsung, Xiaomi, Huawei, etc.) aggressively kill background services. Ask users to:
    • Go to Settings → Apps → Your App → Battery → Unrestricted
    • Or Settings → Battery → Battery Optimization → Your App → Don’t Optimize
  2. Verify notification permission (Android 13+): The SDK uses a foreground service with a notification. On Android 13+, POST_NOTIFICATIONS permission must be granted:
  3. Check WorkManager status: WorkManager handles background scheduling. Verify it’s not constrained:
  4. Lifecycle callbacks: Ensure you’re calling lifecycle methods:
Symptoms: Exception when calling signIn().Solutions:
  1. Check credentials: Ensure you provide either (accessToken + optional refreshToken) or apiKey:
  2. Check network connectivity: Ensure the device can reach your Open Wearables host.
  3. Check token expiration: Access tokens expire. Ensure your backend generates fresh tokens.
  4. Listen for auth errors:
Symptoms: Sync seems to complete but data doesn’t show up in the API.Solutions:
  1. Check logs:
  2. Verify health data exists: Open Health Connect (or Samsung Health) and confirm data exists for the requested types.
  3. Check sync status:
  4. Reset anchors for full sync:
  5. Check permissions: Users may have denied specific data types.
Symptoms: getInstance() throws because SDK wasn’t initialized.Solution: Ensure initialize() is called before getInstance():
Symptoms: Sync session lost after app is killed.Solutions:
  1. Ensure configure() is called on launch:
  2. Check for resumable sessions:
  3. Verify EncryptedSharedPreferences: If the device was factory reset or the app’s data was cleared, stored credentials are lost and the user needs to sign in again.
Symptoms: A persistent notification appears during sync.Solution: This is expected behavior. The SDK uses a foreground service during active data sync for reliability. The notification disappears once the sync cycle completes. You cannot hide this notification — it’s an Android platform requirement for foreground services.

Battery Optimization

Android’s battery optimization can significantly impact background sync. Here’s how different manufacturers handle it:
Consider linking users to dontkillmyapp.com which has device-specific instructions for keeping background services alive.

Testing

Manual Sync Test

Check Stored State

Force Fresh Start

If things are in a bad state:

Debugging Tips

Enable Verbose Logging

Check Provider State

Getting Help

If you’re still experiencing issues:

GitHub Issues

Report bugs or request features on the SDK repository.

Discussions

Ask questions and get help from the community.
When reporting issues, please include:
  • Android version and device model
  • SDK version
  • Health provider used (Samsung Health or Health Connect)
  • Relevant logs from logListener
  • Steps to reproduce