Skip to content
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

Platform exception on health #221

Closed
Goubeast opened this issue Jan 30, 2024 · 1 comment
Closed

Platform exception on health #221

Goubeast opened this issue Jan 30, 2024 · 1 comment

Comments

@Goubeast
Copy link

Goubeast commented Jan 30, 2024

Platform - Android simulator, SDK level 13

Throws a platform exception on accessing health service.

[log] [CAMS INFO] HealthServiceManager - Checking permissions for device of type: HealthService and id: Google Health Connect
E/MethodChannel#flutter_health( 7379): Failed to handle method call
E/MethodChannel#flutter_health( 7379): java.lang.IllegalArgumentException: Unsupported dataType: BASAL_ENERGY_BURNED
E/MethodChannel#flutter_health( 7379): 	at cachet.plugins.health.HealthPlugin.keyToHealthDataType(HealthPlugin.kt:443)
E/MethodChannel#flutter_health( 7379): 	at cachet.plugins.health.HealthPlugin.callToHealthTypes(HealthPlugin.kt:1302)
E/MethodChannel#flutter_health( 7379): 	at cachet.plugins.health.HealthPlugin.hasPermissions(HealthPlugin.kt:1352)
E/MethodChannel#flutter_health( 7379): 	at cachet.plugins.health.HealthPlugin.onMethodCall(HealthPlugin.kt:1536)
E/MethodChannel#flutter_health( 7379): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#flutter_health( 7379): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#flutter_health( 7379): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#flutter_health( 7379): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#flutter_health( 7379): 	at android.os.Handler.handleCallback(Handler.java:942)
E/MethodChannel#flutter_health( 7379): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#flutter_health( 7379): 	at android.os.Looper.loopOnce(Looper.java:201)
E/MethodChannel#flutter_health( 7379): 	at android.os.Looper.loop(Looper.java:288)
E/MethodChannel#flutter_health( 7379): 	at android.app.ActivityThread.main(ActivityThread.java:7872)
E/MethodChannel#flutter_health( 7379): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter_health( 7379): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/MethodChannel#flutter_health( 7379): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
@bardram
Copy link
Contributor

bardram commented Jan 30, 2024

Similar error when running on a phone that does not support Health Connect (SDK 28)

[log] [CAMS INFO] HealthServiceManager - Checking permissions for device of type: HealthService and id: Google Health Connect
[log] [CAMS INFO] WeatherServiceManager - Checking permissions for device of type: WeatherService and id: 12b6e28582eb9298577c734a31ba9f4f
E/MethodChannel#flutter_health( 7112): Failed to handle method call
E/MethodChannel#flutter_health( 7112): java.lang.IllegalArgumentException: Unsupported dataType: BASAL_ENERGY_BURNED
E/MethodChannel#flutter_health( 7112): 	at cachet.plugins.health.HealthPlugin.keyToHealthDataType(HealthPlugin.kt:443)
E/MethodChannel#flutter_health( 7112): 	at cachet.plugins.health.HealthPlugin.callToHealthTypes(HealthPlugin.kt:1302)
E/MethodChannel#flutter_health( 7112): 	at cachet.plugins.health.HealthPlugin.hasPermissions(HealthPlugin.kt:1352)
E/MethodChannel#flutter_health( 7112): 	at cachet.plugins.health.HealthPlugin.onMethodCall(HealthPlugin.kt:1536)
E/MethodChannel#flutter_health( 7112): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#flutter_health( 7112): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#flutter_health( 7112): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#flutter_health( 7112): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#flutter_health( 7112): 	at android.os.Handler.handleCallback(Handler.java:873)
E/MethodChannel#flutter_health( 7112): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#flutter_health( 7112): 	at android.os.Looper.loop(Looper.java:214)
E/MethodChannel#flutter_health( 7112): 	at android.app.ActivityThread.main(ActivityThread.java:7050)
E/MethodChannel#flutter_health( 7112): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter_health( 7112): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
E/MethodChannel#flutter_health( 7112): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

bardram added a commit that referenced this issue Jan 31, 2024
bardram added a commit that referenced this issue Feb 12, 2024
bardram added a commit that referenced this issue Apr 25, 2024
* added support for local deployment - #211

* adding back Health Connect Permission to manifest file - why did they disappear?

* small improvements to informed consent page

* update to iOS dev account

* local mode loads data from assets json files

* Update README.md

* fix of #221

* fix of #125

* Update app_bloc.dart

* Update app_bloc.dart

* Update app_bloc.dart

* compiling on iOS (!)

* docs

* improvements to location handling

* Android only in portrait mode

* adding launch.json

* Create launch.json

* Update launch.json

* iOS - added .entitlements files back for both debug and release

* fix of docs + added health icons for later use

* Support for HEALTH - fix of #220 and #221

* fix of #157

* added support for Movesense devices

* More support for Movesense

* added Movesense HR measures to the HR dataviz card + removed support for skinContact

* Movesense running on iOS

* Update Podfile

* fix of disconnect error in Movesense setup

* handling no informed consent available

* Update local_resource_manager.dart

* new protocol for local movesense testing

* Update .gitignore

* Update instructions for running local deployment

* small improvement to bluetooth connection page

* fix of deprecated WillPopScope

* skipping test w. strange Dart error

* fix of #236

* Fix overflow in task list (#237)

* fix of #241

* fix of #242

* fixed crash issue we had with android themes by adding a theme param to the RedirectUriReceiverActivity (#243)

* Remove leftover code from local testing

* Fix media bar overflow (#249)

* Fix media bar overflow

* Minor foramtting fix

* Removed health package (#255)

* Fix illegible text  in Permission Required dialog button (#251)

* Fix button color

* Fix formatting

* Make location dialog scrollable when text overflows

* Remove carp folder (which is gitignored)

* Bump research package version to v1.4.2 (#256)

* Update research_package to 1.4.3

* Redesign camera preview and improve functionality (#258)

* (WIP) fix camera preview

* Cleanup, improve recording functionality, change recording button color

* Make camera preview full-screen

* Add subtle shadow to icons

* Adjust shadows

* Fix formatting

* Fix stretching of preview

* Fix an issue with late variable initialization

* Test & improvement to streaming upload (#260)

* reverse of init / start

* removed carp assets files locally

* Added default location pop-up text

* upgrade of RP

* Update carp_backend.dart

* update of pubspec to use published packages

* Add launch configurations for vscode and neovim

---------

Co-authored-by: Aamir Farooq <aamir@farooq.xyz>

* Panosfunk/fixing leave study (#261)

* leave study button now works correctly for ios

* fixing logging out caused by bloc. Also changed home route '/' to a variable.

* fixed formatting issue

* removing carp_health_package (#263)

* Improve subtitle for tasks in task list to be more informative of the actual time (#266)

* Add util for humanizing time remaining and use it in task list

* Fix formatting

* Change parameter passed into util

* 275 tapping on a task notification does not take you to the task (#278)

* fixed bluetooth connection dialog missing polar device name, fixed 'Log out'/'Leave Study' dialogs appearing twice.

* Checking for internet connectivity on login page so that we can warm user if they are disconnected. Must double check messages and overall UI look.

* Replaced 'app_settings' package with new 'open_settings_plus' package that allows me to actually access phone settings both in ios and android. Changed dialogs to fit the new capabilities accordingly. Added check_connectivity dialog on the login page to inform user if they have no internet connection.

* implemented different internet connection messages for different OS at login page.

* formatting issue

* making button rows at the end of dialogs be always visible so that user does not have to scroll to the end to click on them. personalized instruction images based on OS.

* popping dialog when user goes to settings

* fixing pixel overflow on bluetooth connection dialogs

* Changed application package name (#271)

* changed application package name from com.cachet.carp_studies_app to dk.carp.studies_app. Fixes #247

* formatting

* disabled 'next' button when trying to connect bluetooth device if no device is selected. Fixed 'close' button malfunctioning on DialogTitle. Fixed typos. Fixed login issue with showing enable_internet_connection_dialog. Checking for connection before allowing user to log out.

* removed unused code

* fixing formatting issues

* fixing issues with 'next' button in devices_page.connection_dialog. Fixing empty/null path issue in signingConfigs storeFile

* added debug buildType so that we can build without having to sign the app. This mode is selected by default by gradle. Commented out Google Health API permissions. Added Danish translations for app localization. Updated version code for next deployment to google store.

* fix of #275 (user task tap)

* fix of #276 and #275

* minor changes

* minor changes

* testing to see if i get this message in the 'Test Details' note in TestFlight.

* testing to see if i get this message in the 'Test Details' note in TestFlight.

* testing to see if i get this message in the 'Test Details' note in TestFlight.

* fix of #275 & #276

* localizing warning screenshots.

* fixing formatting

* Resolve iOS build issues

---------

Co-authored-by: Panosfunk <panosfunk@yahoo.gr>
Co-authored-by: Panagiotis Giannoutsos <36935711+Panosfunk@users.noreply.github.com>
Co-authored-by: Aamir Farooq <aamir@farooq.xyz>

* Fix dependencies for iOS

* Update AndroidManifest.xml to request required permissions for `flutter_local_notifications`

* Update documentation, changelog, bump version

Co-authored-by: Panagiotis Giannoutsos <Panosfunk@users.noreply.github.com>

* Remove unneeded line

* Additional changelog item

---------

Co-authored-by: Aamir Farooq <aamir@farooq.xyz>
Co-authored-by: Aamir Farooq <SlimShadyIAm@users.noreply.github.com>
Co-authored-by: Panagiotis Giannoutsos <36935711+Panosfunk@users.noreply.github.com>
Co-authored-by: Panosfunk <panosfunk@yahoo.gr>
Co-authored-by: Panagiotis Giannoutsos <Panosfunk@users.noreply.github.com>
@bardram bardram closed this as completed Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants