Common Issues
Health Connect permissions not showing
Health Connect permissions not showing
Symptoms: The permission dialog doesn’t appear when calling
requestAuthorization().Solutions:- Ensure Health Connect is installed: Health Connect is pre-installed on Android 14+. On older versions, install it from the Google Play Store.
-
Set Activity before requesting:
-
Verify provider is set:
-
Check min SDK:
Your app’s
minSdkmust be 29 or higher. -
Check Health Connect package query:
The SDK declares this in its manifest, but verify it merged correctly:
Samsung Health not available
Samsung Health not available
Symptoms: Samsung Health provider not found or
setProvider("samsung") returns false.Solutions:- Samsung devices only: Samsung Health SDK typically only works on Samsung devices.
- Samsung Health app must be installed: The user needs the Samsung Health app installed and set up.
-
Try Health Connect instead:
Health Connect works on all Android 10+ devices:
-
Check available providers:
Background sync not working
Background sync not working
Symptoms: Data only syncs when the app is in the foreground.Solutions:
-
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
-
Verify notification permission (Android 13+):
The SDK uses a foreground service with a notification. On Android 13+,
POST_NOTIFICATIONSpermission must be granted: -
Check WorkManager status:
WorkManager handles background scheduling. Verify it’s not constrained:
-
Lifecycle callbacks:
Ensure you’re calling lifecycle methods:
Sign-in fails
Sign-in fails
Symptoms: Exception when calling
signIn().Solutions:-
Check credentials:
Ensure you provide either (
accessToken+ optionalrefreshToken) orapiKey: - Check network connectivity: Ensure the device can reach your Open Wearables host.
- Check token expiration: Access tokens expire. Ensure your backend generates fresh tokens.
-
Listen for auth errors:
Data not appearing in Open Wearables
Data not appearing in Open Wearables
Symptoms: Sync seems to complete but data doesn’t show up in the API.Solutions:
-
Check logs:
- Verify health data exists: Open Health Connect (or Samsung Health) and confirm data exists for the requested types.
-
Check sync status:
-
Reset anchors for full sync:
- Check permissions: Users may have denied specific data types.
SDK not initialized exception
SDK not initialized exception
Symptoms:
getInstance() throws because SDK wasn’t initialized.Solution:
Ensure initialize() is called before getInstance():Sync doesn't resume after app restart
Sync doesn't resume after app restart
Symptoms: Sync session lost after app is killed.Solutions:
-
Ensure configure() is called on launch:
-
Check for resumable sessions:
- 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.
Foreground service notification
Foreground service notification
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:| Manufacturer | Setting Location | Recommendation |
|---|---|---|
| Samsung | Settings → Battery → Background Usage Limits | Allow background activity |
| Xiaomi | Settings → Battery → App Battery Saver | No restrictions |
| Huawei | Settings → Battery → App Launch | Manage manually, enable all |
| OnePlus | Settings → Battery → Battery Optimization | Don’t optimize |
| Pixel/Stock | Settings → Apps → Battery → Unrestricted | Set to Unrestricted |
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.
- Android version and device model
- SDK version
- Health provider used (Samsung Health or Health Connect)
- Relevant logs from
logListener - Steps to reproduce

