-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Health 11.1.1] App crash on Health().hasPermissions([HealthDataType.STEPS]) #1098
Comments
If delete google fit, it is not giving steps count even health connect is already installed. Can someone tell why this is hapenning.? |
From my understanding, as mention in the website, Health connect is a central dashboard. you need health connect to acces data from google fit. |
@tajjacob |
@yogeshButani yes. |
@tajjacob NOTE: Google has deprecated the Google Fit API. According to the documentation, as of May 1st 2024 developers cannot sign up for using the API. As such, this package has removed support for Google Fit as of version 11.0.0 and users are urged to upgrade as soon as possible. |
@yogeshButani google fit is still there but we cannot access it. |
@yogeshButani If the logs are from the health app example try to reduce the number of permissions being asked by the app. Also bear in mind that from Health 11, the package does not support Google Fit anymore and if the issues are related to Google Fit, you should update your application. |
In the example app I just made a extra button to check the permissions on Android 13 and everything was working fine, even if the permission was not given. Future<void> checkStepPermissions() async {
bool? hasPermissions = await Health().hasPermissions([HealthDataType.STEPS]);
debugPrint('Has permissions to read steps: $hasPermissions');
} Perhaps it is how you're implementing the package that causes the issue? |
Plugin Name
health
Plugin Version
1.11.1
Device
Pixel 8 PRO API 33, Samsung Galaxy S10+
Operating System
Android 13, Android 9
Describe the bug
App crashes on devices with android version of 13 and bellow while attempting to read permision status via
Health().hasPermissions([HealthDataType.STEPS])
.Steps to Reproduce
Unfortunatelly it doesnt reporuce on example app. But in my scenario i run
final sdkStatus = await Health().getHealthConnectSdkStatus();
after if sdkStatus == HealthConnectSdkStatus.sdkAvailable i run Health().hasPermissions([HealthDataType.STEPS]) which leads to crash.Expected Behavior
Not to crash
Actual Behavior
Crash. Tried wrapping this in try-catch block but it fatals anyway
Flutter Logs
Screenshots
No response
Flutter Doctor Output
Additional Information
No response
The text was updated successfully, but these errors were encountered: