fit-samples icon indicating copy to clipboard operation
fit-samples copied to clipboard

WearOS error 17: Error resolution was canceled by the user, original error message: INVALID_ACCOUNT: null

Open nurseybushc opened this issue 3 years ago • 2 comments

In my fork, I have added a WearOS module to BasicRecordingApiKotlin. I have the regular mobile module version working correctly and am able to push and pull data from Google Fit. The Google Fit specific code and OAuth settings on console.developer.google.com are exactly same as the mobile app version however only on WearOS versions am I receiving this error
error 17: Error resolution was canceled by the user, original error message: INVALID_ACCOUNT: null
when running Fitness.getRecordingClient(this, getGoogleAccount()).subscribe(DataType.TYPE_CALORIES_EXPENDED)
always entering onFailureListener.

The main question I have is, is there something specifically different either in code or in app/project setup that needs to be done for WearOS that I'm not doing currently? Or can someone point to a repo that has a working up-to-date Google Fit WearOS Kotlin sample?

My Setup: 
MacOS Catalina 10.15.7
Android Studio: 4.1.1
Kotlin Version: 1.3.61
com.google.android.gms:play-services-fitness: 20.0.0
com.google.android.gms:play-services-auth: 19.0.0

Physical Device: 
TicWatch Pro
System Version: H
WearOS by Google: 2.19
Android security patch level: June 1, 2020

I have also opened a question on stackoverflow.com. It has many screenshots which might be relevant but I thought might not need to be duplicated here

Thanks and I appreciate any help and will add more information if requested or something is unclear.

P.S.: I also got BasicHistorySessionApiKotlin mobile module version working and the added WearOS module gets same error

nurseybushc avatar Nov 19 '20 22:11 nurseybushc

Same issue. Can anyone help or is the Google Fit API just fucking broken? Sorry for being harsh, but getting health data on an Apple Watch is 10000x easier than this. Imaging being more restrictive with data access than Apple.

Rexios80 avatar May 13 '21 21:05 Rexios80

So the sample code works on a phone, but not a watch. WHY.

Rexios80 avatar May 13 '21 22:05 Rexios80