flutter-plugins icon indicating copy to clipboard operation
flutter-plugins copied to clipboard

[health 9.0.0] requestAuthorization method never returns on Android

Open bardram opened this issue 1 year ago • 3 comments

Device / Emulator and OS

  • Device: Samsung G9
  • OS: Android SDK 31

When calling the requestAuthorization() method on Android, the method never returns. So if awaiting this then the execution stops.

Using Health Connect.

bardram avatar Feb 12 '24 14:02 bardram

https://github.com/cph-cachet/flutter-plugins/issues/847

I had to revert back to health 8.0.0 to get it working for android again.

Kam5678 avatar Feb 14 '24 03:02 Kam5678

Have you tried this: https://github.com/cph-cachet/flutter-plugins/issues/888#issuecomment-1931983263

That worked for me. Specifically updating MainActivity.kt as follows:

package xx.xx.xxxx --> your package

import android.os.Bundle
import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity() {
}

hagen00 avatar Feb 15 '24 08:02 hagen00

Hey Hagan, thank you for replying. I was actually able to get it working with your help, so thank you!

Kam5678 avatar Mar 03 '24 07:03 Kam5678