Skip to content

Requirements

Version floors for the current release, and what each one is actually for.

Toolchain

ComponentRequirement
Flutter≥ 3.35.7
Dart^3.9.2 (declared in the package's pubspec.yaml)
Android OSAPI 26+ (Android 8.0) at build time
Kotlin2.1.0
Java17
iOS15.0+
Swift5.9

The Flutter floor is enforced by pub, not advisory

sdk: ^3.9.2 resolves only against Flutter 3.35.x and later. On Flutter 3.32 (Dart 3.8) pub get fails outright — there is no way to use this package on an older Flutter.

Upgrading is normally cheap, though: Flutter 3.35.7 is source-compatible with apps written for 3.32.0, and for 3.27.0 if you are already on Material 3. Swift 5.9 accepts Swift 5.0 code and Kotlin 2.1 accepts Kotlin 2.0, so the native side is a version bump in your build files.

Android build configuration

SettingValueWhy
minSdkVersion26Compile floor of the Health Connect client library
compileSdkExtension19Required by Health Connect 1.2.0-alpha03, which Health Connector SDK v3.9.0+ builds against
android.useAndroidXtrueHealth Connect is built on AndroidX
android.enableJetifieromitDeprecated; only needed for legacy support-library dependencies
MainActivity base classFlutterFragmentActivityPermission requests use registerForActivityResult, which needs a FragmentActivity host
groovy
android {
    compileSdkExtension 19

    defaultConfig {
        minSdkVersion 26
    }
}

compileSdkExtension 19 is not the same as SDK Extension 21

Extension 19 satisfies the build. Writing ExerciseSessionSegmentEvent.weight separately requires the device's Health Connect Mainline module to be at Extension 21, checked at runtime. Details.

iOS build configuration

SettingValueWhy
Minimum Deployments15.0SDK floor
HealthKit capabilityEnabledRequired entitlement
NSHealthShareUsageDescriptionSpecific stringShown when requesting read access
NSHealthUpdateUsageDescriptionSpecific stringShown when requesting write access

Some data types require newer iOS versions than 15.0 — those carry an @supportedOnAppleHealthIOS16Plus-style annotation and throw below their floor. See Annotations.

Runtime availability

Meeting the build requirements does not guarantee a usable health store. Always check first:

dart
final status = await HealthConnector.getHealthPlatformStatus();
SituationPlatformResult
Health Connect missing or outdatedAndroidUnavailable — call launchHealthAppPageInAppStore()
Device policy restricts health dataBothUnavailable — no code fix
iPadiOSHealthKit not present

Released under the Apache 2.0 License.