Open leonidlist opened 1 year ago
FYI: I’m trying to fix the issue so I’ll create a PR for that soon I guess
FYI: I’m trying to fix the issue so I’ll create a PR for that soon I guess
Hi, did you fix this?
I have raised a pr for this https://github.com/cph-cachet/flutter-plugins/pull/707/
Hi,
I recently upgraded from 3.4.4 to Health 6.0 and ran in the same issue. This looks very much like an issue I ran into with version 3.4.3 which has been solved in version 3.4.4 (see: https://github.com/cph-cachet/flutter-plugins/issues/500)
Since I cannot downgrade due to other plugin version dependencies, I temporarily solved the issue by adding these types to the SwiftHealthPlugin.swift:
unitDict[SLEEP_IN_BED] = HKUnit.init(from: "")
unitDict[SLEEP_ASLEEP] = HKUnit.init(from: "")
unitDict[SLEEP_AWAKE] = HKUnit.init(from: "")
This at least solves the crash and saves the sleep session correctly.
Best regards,
Sam
Device / Emulator and OS
Describe the bug
Can’t write sleep data, application crashes with error
Could not cast value of type 'HKCategoryType' to 'HKQuantityType'.
To Reproduce
Try to write any sleep data
Expected behavior
Sleep data is written and app didn’t crash :D
Flutter doctor
Additional information
I’m investigating it now, but it’s 100% related to this code block in SwiftHealthPlugin.swift