Skip to content
AF

Health Connect error codes and exceptions

9 error codes · 6 Jetpack exception types · last fetched from Google’s reference on 2026-10-03

android.health.connect.HealthConnectException defines 9 error codes, values 1 to 9, all added at API level 34. Google likens 5 of them to an existing exception class. The Jetpack HealthConnectClient reference documents 6 exception types in its Throws tables — SecurityException, RemoteException, IOException, IllegalArgumentException, IllegalStateException and UnsupportedOperationException — and does not name HealthConnectException at all.

The iOS counterpart is every HealthKit error code. Release-by-release changes to the Jetpack library are tracked on Health Connect SDK releases, and an empty read with no error at all is worked through in Health Connect returns no data.

HealthConnectException constants (9)

By value, as printed under “Constant Value” on Google’s reference (the page's own footer says it was last updated 2026-08-03). Descriptions are Google’s, verbatim. “Similar to” is copied from Google’s sentence and is blank where Google draws no comparison.

ValueConstantGoogle’s descriptionSimilar toAdded
10x00000001ERROR_UNKNOWNAn unknown error occurred while processing the call.API 34U Extensions 7
20x00000002ERROR_INTERNALAn internal error occurred which the caller cannot address.This error may be considered similar to IllegalStateExceptionIllegalStateExceptionAPI 34U Extensions 7
30x00000003ERROR_INVALID_ARGUMENTThe caller supplied invalid arguments to the call.This error may be considered similar to IllegalArgumentException.IllegalArgumentExceptionAPI 34U Extensions 7
40x00000004ERROR_IOAn issue occurred reading or writing to storage. The call might succeed if repeated.This error may be considered similar to IOException.IOExceptionAPI 34U Extensions 7
50x00000005ERROR_SECURITYFix guideThe caller doesn't have the correct permissions for this call.This error may be considered similar to SecurityException.SecurityExceptionAPI 34U Extensions 7
60x00000006ERROR_REMOTEAn IPC related error occurred.This error may be considered similar to RemoteException.RemoteExceptionAPI 34U Extensions 7
70x00000007ERROR_RATE_LIMIT_EXCEEDEDFix guideThe caller exhausted the allotted rate limit.API 34U Extensions 7
80x00000008ERROR_DATA_SYNC_IN_PROGRESSData sync is in progress. Data read and writes are blocked.Caller should try this api call again later.API 34U Extensions 7
90x00000009ERROR_UNSUPPORTED_OPERATIONThis operation is currently not supported by the platform.Caller may try this api call again later.API 34U Extensions 7

What HealthConnectClient documents (6)

Every exception named in a “Throws” table on the Jetpack HealthConnectClient reference, grouped by class, with each distinct wording Google uses and the methods it appears on. Ordered by how many methods document it. This is what the reference states, not a list of everything a call can raise at runtime.

ExceptionGoogle’s wordingDocumented on
SecurityExceptionFix guide
  • “For requests with unpermitted access.” (12 methods)
  • “if caller does not hold PERMISSION_WRITE_MEDICAL_DATA.” (3 methods)
15 methods: aggregate, aggregateGroupByDuration, aggregateGroupByPeriod, deleteRecords, getChanges, getChangesToken, insertRecords, readRecord, readRecords, updateRecords, HealthConnectClient.deleteRecords, HealthConnectClient.readRecord, createMedicalDataSource, deleteMedicalResources, upsertMedicalResources
RemoteExceptionandroid.os.RemoteException
  • “For any IPC transportation failures.” (9 methods)
  • “For any IPC transportation failures. Deleting by invalid identifiers such as a non-existing identifier or deleting the same record multiple times will result in IPC failure.” (2 methods)
  • “For any IPC transportation failures. Update with invalid identifiers will result in IPC failure.” (3 methods)
12 methods: aggregate, aggregateGroupByDuration, aggregateGroupByPeriod, deleteRecords, getChanges, getChangesToken, insertRecords, readRecords, HealthConnectClient.deleteRecords, readRecord, updateRecords, HealthConnectClient.readRecord
IOExceptionjava.io.IOException
  • “For any disk I/O issues.” (10 methods)
10 methods: aggregate, aggregateGroupByDuration, aggregateGroupByPeriod, deleteRecords, insertRecords, readRecord, readRecords, updateRecords, HealthConnectClient.deleteRecords, HealthConnectClient.readRecord
IllegalArgumentException
  • “if id is invalid, does not exist, or owned by another app.” (1 method)
  • “if the size of ids is too large or any ID is deemed as invalid.” (1 method)
  • “if any request is failed to be processed for any reason such as invalid UpsertMedicalResourceRequest.dataSourceId” (1 method)
3 methods: deleteMedicalDataSourceWithData, readMedicalResources, upsertMedicalResources
IllegalStateException
  • “if the SDK is not available” (1 method)
  • “If service is not available.” (2 methods)
3 methods: getOrCreate, HealthConnectClient.deleteRecords, HealthConnectClient.readRecord
UnsupportedOperationException
  • “if service not available due to SDK version too low or running in a profile” (1 method)
  • “if the feature is not available.” (2 methods)
3 methods: getOrCreate, checkIfMatchmakingIsPossible, createMatchmakingIntent

Questions

What does each Health Connect error code number mean?

HealthConnectException.getErrorCode() returns one of 9 constants. As Google's reference printed them on 2026-10-03: 1 is ERROR_UNKNOWN (“An unknown error occurred while processing the call.”); 2 is ERROR_INTERNAL (“An internal error occurred which the caller cannot address.”); 3 is ERROR_INVALID_ARGUMENT (“The caller supplied invalid arguments to the call.”); 4 is ERROR_IO (“An issue occurred reading or writing to storage. The call might succeed if repeated.”); 5 is ERROR_SECURITY (“The caller doesn't have the correct permissions for this call.”); 6 is ERROR_REMOTE (“An IPC related error occurred.”); 7 is ERROR_RATE_LIMIT_EXCEEDED (“The caller exhausted the allotted rate limit.”); 8 is ERROR_DATA_SYNC_IN_PROGRESS (“Data sync is in progress. Data read and writes are blocked.”); 9 is ERROR_UNSUPPORTED_OPERATION (“This operation is currently not supported by the platform.”).

Which Health Connect errors does Google say may succeed on a later attempt?

3 constants, going by Google's own wording: ERROR_IO — “The call might succeed if repeated.”; ERROR_DATA_SYNC_IN_PROGRESS — “Caller should try this api call again later.”; ERROR_UNSUPPORTED_OPERATION — “Caller may try this api call again later.” The reference says nothing about retrying the others, so treat a retry of those as your own decision, and bound it.

Does the Jetpack HealthConnectClient reference mention HealthConnectException?

No. In the 2026-10-03 read the HealthConnectClient reference page does not name HealthConnectException at all. Its Throws tables document 6 exception types instead: SecurityException, RemoteException, IOException, IllegalArgumentException, IllegalStateException and UnsupportedOperationException. HealthConnectException belongs to the android.health.connect platform API; the second table on this page lists what the Jetpack reference documents.

Which Health Connect error codes does Google compare to standard exceptions?

5 constants carry Google's sentence “This error may be considered similar to …”: ERROR_INTERNAL to IllegalStateException, ERROR_INVALID_ARGUMENT to IllegalArgumentException, ERROR_IO to IOException, ERROR_SECURITY to SecurityException, ERROR_REMOTE to RemoteException. The other 4 have no such comparison.

Which Android API level added HealthConnectException?

Google's reference prints “Added in API level 34” for the class, also available in U Extensions 7. All 9 ERROR_* constants were added at API level 34, so none of them is newer than the class.

Read on 2026-10-03 from Google’s HealthConnectException and HealthConnectClient references by scripts/fetch-error-codes.mjs. Compiled by AIFitnessAPI; Google’s documentation remains the authority. All platforms’ error codes are indexed at error codes.