cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
551 stars 681 forks source link

[health 9.0.0] requestAuthorization method never returns on Android #897

Open bardram opened 9 months ago

bardram commented 9 months ago

Device / Emulator and OS

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

Using Health Connect.

Kam5678 commented 9 months ago

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.

hagen00 commented 9 months ago

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() {
}
Kam5678 commented 8 months ago

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