Bug Report
Package
health: 13.3.1
Platform
iOS (simulator, iOS 26.4)
Description
TOTAL_CALORIES_BURNED is listed in dataTypeKeysIOS (in lib/src/heath_data_types.dart) but is not registered in the native iOS dataTypesDict dictionary (in ios/Classes/SwiftHealthPlugin.swift).
When requestAuthorization is called with this type on iOS, the native code looks up the type in dataTypesDict, gets nil, and passes nil into HKHealthStore._validateAuthorizationRequestWithShareTypes:readTypes:, which throws an NSException (SIGABRT) — killing the app process immediately.
The crash is not catchable in Dart because it is a native-level abort, not a thrown Dart exception.
Steps to Reproduce
- Add
health: ^13.3.1 to your Flutter project
- Call
health.requestAuthorization([HealthDataType.TOTAL_CALORIES_BURNED]) on an iOS simulator (or device)
- App crashes immediately with
SIGABRT
Crash Log
"exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
"termination" : {"flags":0,"code":6,"namespace":"SIGNAL","indicator":"Abort trap: 6"},
"lastExceptionBacktrace" : [
__exceptionPreprocess,
objc_exception_throw,
-[HKHealthStoreImplementation _validateAuthorizationRequestWithShareTypes:readTypes:],
-[HKHealthStoreImplementation requestAuthorizationToShareTypes:readTypes:shouldPrompt:completion:],
HealthDataOperations.requestAuthorization(call:result:)
]
Expected Behavior
Either:
- Option A: Register
TOTAL_CALORIES_BURNED in dataTypesDict on iOS (e.g., mapping to a combined active + basal energy type), or
- Option B: Remove
TOTAL_CALORIES_BURNED from dataTypeKeysIOS so it is not advertised as a supported iOS type.
Relevant Files
lib/src/heath_data_types.dart — TOTAL_CALORIES_BURNED listed in dataTypeKeysIOS
ios/Classes/SwiftHealthPlugin.swift — dataTypesDict does not contain a mapping for TOTAL_CALORIES_BURNED
Bug Report
Package
health: 13.3.1
Platform
iOS (simulator, iOS 26.4)
Description
TOTAL_CALORIES_BURNEDis listed indataTypeKeysIOS(inlib/src/heath_data_types.dart) but is not registered in the native iOSdataTypesDictdictionary (inios/Classes/SwiftHealthPlugin.swift).When
requestAuthorizationis called with this type on iOS, the native code looks up the type indataTypesDict, getsnil, and passesnilintoHKHealthStore._validateAuthorizationRequestWithShareTypes:readTypes:, which throws anNSException(SIGABRT) — killing the app process immediately.The crash is not catchable in Dart because it is a native-level abort, not a thrown Dart exception.
Steps to Reproduce
health: ^13.3.1to your Flutter projecthealth.requestAuthorization([HealthDataType.TOTAL_CALORIES_BURNED])on an iOS simulator (or device)SIGABRTCrash Log
Expected Behavior
Either:
TOTAL_CALORIES_BURNEDindataTypesDicton iOS (e.g., mapping to a combined active + basal energy type), orTOTAL_CALORIES_BURNEDfromdataTypeKeysIOSso it is not advertised as a supported iOS type.Relevant Files
lib/src/heath_data_types.dart—TOTAL_CALORIES_BURNEDlisted indataTypeKeysIOSios/Classes/SwiftHealthPlugin.swift—dataTypesDictdoes not contain a mapping forTOTAL_CALORIES_BURNED