Google fit api doesn't work on galaxy watch 4 - wear-os

I'm developing app for watch 4 and I want to use google fit api, but it doesn't work.
When I try to create recording, sensors, history and other clients and subscribe to the sensors (ex: OXYGEN_SATURATION or STEP_COUNT or TYPE_HEART_RATE_BPM ) (by this guide: https://developers.google.com/fit/android/api-client-example), I get this error:
API: Fitness.CLIENT is not available on this device. Connection failed with: ConnectionResult{statusCode=INVALID_ACCOUNT, resolution=null, message=null}.
I accepted all permission for google fit sensors.
I use galaxy watch4 classic (sm-r880) (bought in Russia).
I tried to build and launch this app on the galaxy s9 (sm-g960f) and it's working fine, I don't get this error when launch the same code and I can create clients and subscribe to the sensors.
I used the same google account for mobile and watch.
I prepared logs that I collected via logcat from watch 4 and galaxy 9. You can find in the watch logs that any client are not available
2021-11-15 20:03:57.683 3268-3268/com.test.app.watch E/RCPLog: MainActivity.invokeSuspend() -> addOnFailureListener it: 17: API: Fitness.CLIENT is not available on this device. Connection failed with: ConnectionResult{statusCode=INVALID_ACCOUNT, resolution=null, message=null}
2021-11-15 20:03:57.752 3268-3268/com.test.app.watch E/RCPLog: MainActivity.onCreate() -> addOnFailureListener it: 17: API: Fitness.RECORDING_CLIENT is not available on this device. Connection failed with: ConnectionResult{statusCode=INVALID_ACCOUNT, resolution=null, message=null}
2021-11-15 20:03:57.779 3268-3268/com.test.app.watch E/RCPLog: MainActivity.onCreate() -> addOnFailureListener it: 17: API: Fitness.SESSIONS_CLIENT is not available on this device. Connection failed with: ConnectionResult{statusCode=INVALID_ACCOUNT, resolution=null, message=null}
2021-11-15 20:03:57.850 3268-3268/com.test.app.watch E/RCPLog: MainActivity.onCreate() -> Find data sources request failed e com.google.android.gms.common.api.ApiException: 17: API: Fitness.SENSORS_CLIENT is not available on this device. Connection failed with: ConnectionResult{statusCode=INVALID_ACCOUNT, resolution=null, message=null}
But on the galaxy 9 all works fine and I can see logs like this "addOnSuccessListener" not like this "addOnFailureListener" (the same code):
2021-11-15 20:13:05.020 32276-32276/com.test.app.watch E/RCPLog: MainActivity.invokeSuspend() -> addOnSuccessListener
2021-11-15 20:13:05.020 32276-32276/com.test.app.watch E/RCPLog: MainActivity.onCreate() -> addOnSuccessListener
2021-11-15 20:13:05.020 32276-32276/com.test.app.watch E/RCPLog: MainActivity.onCreate() -> Data source found: raw:com.google.heart_rate.bpm:samsung:SM-G960F:de5dc392:HeartRate Sensor
2021-11-15 20:13:05.020 32276-32276/com.test.app.watch E/RCPLog: MainActivity.onCreate() -> Data Source type: com.google.heart_rate.bpm
2021-11-15 20:13:05.021 32276-32276/com.test.app.watch E/RCPLog: MainActivity.onCreate() -> Data source for TYPE_HEART_RATE_BPM found!
2021-11-15 20:13:05.039 32276-32276/com.test.app.watch E/RCPLog: MainActivity.onCreate() -> addOnSuccessListener`
https://www.dropbox.com/s/cd6mv6eebib11gc/Logs_from_galaxy_9.txt?dl=0
https://www.dropbox.com/s/yk7q08n57amdoqo/Logs_from_watch4.txt?dl=0
Maybe I use google fit api wrong, but why the same code are working on the mobile device and not working on the watch?
Maybe google fit api doesn't work on the galaxy watch4?
Thanks!

From what I understand the Samsung Galaxy Watch 4 doesn't have the Google Fit APIs (and probably never will). Instead, it ships with Samsung Health. I haven't worked with Samsung Health and don't know if there is an API that you can use instead on that specific device. You can find more details about Samsung Health here and hopefully figure out if it allows you to do the same things that you currently rely on Google Fit for.
In the future you might be able to use the new Health Services API instead but that's still in alpha.

Related

Issue Connecting to Mac Agent from Windows

I got the following issue while connecting to Mac Agent.
Previously when using Xcode 9.2 i got no such issues but later when updated to Xcode 9.3 the following log was showed.
Getting this error even when the Mac credentials are correct.
Xamarin.VisualStudio.TastyPackage|Information|0|Hooked up SDB tracing adapter
Xamarin.VisualStudio.TastyPackage|Information|0|Initialization finished
Xamarin|Information|0|Xamarin - 4.8.0.760-d15-5+fc93f3f5b
Xamarin.VisualStudio.Activation.AccountManager|Information|0|VS2017 Community
Xamarin.VisualStudio.Activation.ActivationManager|Information|0|No license found for iOS
Xamarin.VisualStudio.Activation.ActivationManager|Information|0|Running license sync for iOS
Xamarin.VisualStudio.Activation.ActivationManager|Information|0|Not logged in, using iOS Community
Xamarin.VisualStudio.Activation.ActivationManager|Information|0|No license found for Android
Xamarin.VisualStudio.Activation.ActivationManager|Information|0|Running license sync for Android
Xamarin.VisualStudio.Activation.ActivationManager|Information|0|Not logged in, using Android Community
Xamarin.VisualStudio.TastyPackage|Information|0|Hooked up SDB tracing adapter
Xamarin.VisualStudio.TastyPackage|Information|0|Initialization finished
Xamarin.VisualStudio.Android.XamarinAndroidPackage|Warning|0|Initializing Xamarin.VisualStudio.Android.XamarinAndroidPackage
Xamarin.Inspector|Information|0|Inspector extension loaded
Xamarin.VisualStudio.TastyPackage|Information|0|Hooked up SDB tracing adapter
Xamarin.VisualStudio.TastyPackage|Information|0|Initialization finished
Xamarin.VisualStudio.IOS.XamarinIOSPackage|Warning|0|Initializing Xamarin.VisualStudio.IOS.XamarinIOSPackage.
Xamarin.VisualStudio.ProjectFixerRunner|Information|0|Solution loaded: 'App1'
Xamarin.VisualStudio.ProjectFixerRunner|Information|0|running fixup on project 'F:\Bharath\Project Materials\App1\App1\App1.Android\App1.Android.csproj'
Xamarin.VisualStudio.ProjectFixerRunner|Information|0|running fixup on project 'F:\Bharath\Project Materials\App1\App1\App1.iOS\App1.iOS.csproj'
Xamarin.VisualStudio.Android.ContinuousPlayerDeviceProvider|Information|0|Start()
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Server State transition from DisconnectedState to ConfiguringState on 192.168.XXX.XX (192.168.XXX.XX)
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Checking host configuration for connecting to '192.168.XXX.XX'...
Xamarin.Messaging.Ssh.SshCommandRunner|Warning|0|Failed to execute 'grep "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJ0uNVUuKpZY5t3ea5q5JjTFn7AGfrSHeyDGJ0S83Plh05t4neDyk8jtt7WSqFM8FeY31i5N55FaYOnxwRvzcYJxo01PWuudNKtB6L4pk0PxN1cYTG8RqCLw0DM9GVL4cULgENsofpkxCu648qpIbbXl+Bwj7ScP8JV8b9vMFART59iWYlF1iuzFoLt4NE3uX24m7R/W2G9ypxDRHRB5YAAeVXPm9j5BlHzLHaCmIQezJr7T/d0PEr/09IV1CrQ56Q11RPMH7YHXILzHKhmYO+gwEUrgwvYo68/9P7E3nbzCVEikOHIdxAYHjd59Ma7y/u2iicEjfzwXXoMbkhuyZB GD#GD-MacBook-Pro.local" /Users/GD/.ssh/authorized_keys': ExitStatus = 1
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Checking host configuration for connecting to '192.168.XXX.XX'...
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Server State transition from ConfiguringState to ConfiguredState on 192.168.XXX.XX (192.168.XXX.XX)
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Host '192.168.XXX.XX' is configured correctly
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Server State transition from ConfiguredState to ConnectingState on 192.168.XXX.XX (192.168.XXX.XX)
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Starting connection to '192.168.XXX.XX'...
Xamarin.Messaging.Ssh.MessagingService|Information|0|Starting connection to 192.168.XXX.XX...
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Starting connection to '192.168.XXX.XX'...
Xamarin.Messaging.Integration.State.ServerStateContext|Error|0|Unable to authenticate with SSH keys. Please try to log in with credentials first
Xamarin.Messaging.Ssh.Exceptions.MessagingAuthenticationException: Could not authenticate the user 'GD'R with SSH keys. Please check that both $HOME folder and ~/.ssh/authorized_keys have the appropiate permissions to use SSH. More details: Permission denied (publickey). ---> Renci.SshNet.Common.SshAuthenticationException: Permission denied (publickey).
at Renci.SshNet.ClientAuthentication.Authenticate(IConnectionInfoInternal connectionInfo, ISession session)
at Renci.SshNet.ConnectionInfo.Authenticate(ISession session, IServiceFactory serviceFactory)
at Renci.SshNet.Session.Connect()
at Renci.SshNet.BaseClient.Connect()
at Xamarin.Messaging.Ssh.SshMessagingConnection.ConnectSsh(Boolean forwardTcpPort) in C:\d\lanes\5409\fc93f3f5\source\xamarinvs\External\messaging\src\Xamarin.Messaging.Ssh\SshMessagingConnection.cs:line 138
at Xamarin.Messaging.Ssh.MessagingService.<ConnectAsync>d__66.MoveNext() in C:\d\lanes\5409\fc93f3f5\source\xamarinvs\External\messaging\src\Xamarin.Messaging.Ssh\MessagingService.cs:line 225
--- End of inner exception stack trace ---
Xamarin.Messaging.Ssh.SshMessagingConnection|Error|0|An unexpected error occurred with the current SSH Session
Renci.SshNet.Common.SshConnectionException: An established connection was aborted by the server.
at Renci.SshNet.Session.SocketRead(Int32 length, Byte[] buffer)
at Renci.SshNet.Session.ReceiveMessage()
at Renci.SshNet.Session.MessageListener()
You always have to open XCode after you have updated it. It the most case it will install additional components and sometimes you have to accept new terms.

Google Assistant Hotword Detection Not Working

I'm new to Google Assistant SDK. Recently I embedded Assistant to Raspberry Pi 3 B. I used the googlesamples-assistant-hotword sample. It worked fine. But next time I run the command I got some errors. I reinstall the sdk and tried, but got the same error. However googlesamples-assistant-pushtotalk still works. But googlesamples-assistant-hotword gives errors. How can I fix this. The errors I got are as follows;
(env) pi#raspberrypi:~$ googlesamples-assistant-hotword
ON_MUTED_CHANGED:
{u'is_muted': False}
ON_START_FINISHED
E0922 08:01:19.189206804 9868 handshake.c:128] Security handshake failed: {"created":"#1506047479.189164282","description":"Handshake read failed","file":"../../third_party/grpc/src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"#1506047479.189160249","description":"FD shutdown","file":"../../third_party/grpc/src/core/lib/iomgr/ev_epoll_linux.c","file_line":1045}]}
E0922 08:01:20.189959242 9868 handshake.c:128] Security handshake failed: {"created":"#1506047480.189916251","description":"Handshake read failed","file":"../../third_party/grpc/src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"#1506047480.189911706","description":"FD shutdown","file":"../../third_party/grpc/src/core/lib/iomgr/ev_epoll_linux.c","file_line":1045}]}
E0922 08:01:21.190931499 9868 handshake.c:128] Security handshake failed: {"created":"#1506047481.190904069","description":"Handshake read failed","file":"../../third_party/grpc/src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"#1506047481.190900454","description":"FD shutdown","file":"../../third_party/grpc/src/core/lib/iomgr/ev_epoll_linux.c","file_line":1045}]}
[9782:9800:ERROR:speech_recognition_activity.cc(550)] S3 connection has timed out: No data from S3

System.Net.Http.HttpRequestException exception will running th xamarin UI Test on Physical Device

I have created a simple Xamarin.Forms(Portable) project and included UI Test project in it. But when i am trying to run the test in physical device it giving me below mentioned exception.
Test Name: AppLaunches
Test Outcome: Failed
Result Message:
SetUp : System.Net.Http.HttpRequestException : An error occurred while sending the request.
----> System.Net.WebException : The underlying connection was closed: The connection was closed unexpectedly.
Result StandardOutput: Full log file: C:\Users\Admin\AppData\Local\Temp\uitest\log-2016-10-22_11-04-53-698.txt
Skipping IDE integration as important properties are configured. To force IDE integration, add .PreferIdeSettings() to ConfigureApp.
Android test running Xamarin.UITest version: 2.0.0.1534
Initializing Android app on device ZX1D63GCCL with installed app: co.veloxcore.UITestSample2
Signing apk with Xamarin keystore.
Skipping installation: Already installed.
Here is the link to my project: XamarinUITest
Log File : Error Log
Are you using using ModernHttpClient?
Also you can use Polly if you want to handle network exceptions.
For example:
conferences = await Policy
.Handle<WebException>()
.WaitAndRetry
(
retryCount:5,
sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))
)
.ExecuteAsync(async () => await getConferencesTask);
Also AsyncErrorHandler is great tool to handle async exceptions

Upgrade to new XCode; can't built in Xamarin

I think that one of the last XCode upgrades that came in last week appears to have broken my Xamarin iOS builds. They fail with:
Failed to locate a valid instance of CoreSimulatorService in the bootstrap. Adding it now.
Or
.../SignInUniversalController_iPhone.storyboard: Error: 2016-07-31 12:11:38.046 ibtoold[23284:2756861] [MT] IBPlatformTool: *** Failed to launch tool with description <IBCocoaTouchPlatformToolDescription: 0x7fce44256b20> System content 1x for IBCocoaTouchFramework-NineOneAndLater w/ default fidelity:
Failed to find or create execution context for description <IBCocoaTouchPlatformToolDescription: 0x7fce44256b20> System content 1x for IBCocoaTouchFramework-NineOneAndLater w/ default fidelity (Failure reason: Software caused connection abort): Failed to find a suitable device for the type SimDeviceType : com.apple.dt.Xcode.IBSimDeviceType.iPad-1x with runtime SimRuntime : 9.3 (13E230) - com.apple.CoreSimulator.SimRuntime.iOS-9-3 (Failure reason: Failed to create SimDeviceSet at path /Users/eric/Library/Developer/Xcode/UserData/IB Support/Simulator Devices. You'll want to check the logs in ~/Library/Logs/CoreSimulator to see why creating the SimDeviceSet failed.): Failed to initialize simulator device set. (Failure reason: Failed to subscribe to notifications from CoreSimulatorService.): Error returned in reply to notification request: Connection invalid (Failure reason: Software caused connection abort)
2016-07-31 12:11:46.096 ibtoold[23284:2756861] [MT] IBPlatformTool: Wrote failed marshalling request diagnostics to path: /var/folders/t9/t9xl93t50ql14mr0lxmmw_2r0000gn/T/IB-agent-diagnostics_2016-07-31_12-11-46_067000
Error: Internal error. Please file a bug at bugreport.apple.com and attach "/var/folders/t9/t9xl93t50ql14mr0lxmmw_2r0000gn/T/IB-agent-diagnostics_2016-07-31_12-11-46_067000".
The logs mentioned in the first error message doesn't appear to be more verbose than the above:
Failed to find or create execution context for description <IBCocoaTouchPlatformToolDescription: 0x7fce44256b20> System content 1x for IBCocoaTouchFramework-NineOneAndLater w/ default fidelity (Failure reason: Software caused connection abort): Failed to find a suitable device for the type SimDeviceType : com.apple.dt.Xcode.IBSimDeviceType.iPad-1x with runtime SimRuntime : 9.3 (13E230) - com.apple.CoreSimulator.SimRuntime.iOS-9-3 (Failure reason: Failed to create SimDeviceSet at path /Users/eric/Library/Developer/Xcode/UserData/IB Support/Simulator Devices. You'll want to check the logs in ~/Library/Logs/CoreSimulator to see why creating the SimDeviceSet failed.): Failed to initialize simulator device set. (Failure reason: Failed to subscribe to notifications from CoreSimulatorService.): Error returned in reply to notification request: Connection invalid (Failure reason: Software caused connection abort)
Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedDescription=Failed to find or create execution context for description <IBCocoaTouchPlatformToolDescription: 0x7fce44256b20> System content 1x for IBCocoaTouchFramework-NineOneAndLater w/ default fidelity, NSUnderlyingError=0x7fce44152c40 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSUnderlyingError=0x7fce441b8150 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedFailureReason=Failed to subscribe to notifications from CoreSimulatorService., NSLocalizedDescription=Failed to initialize simulator device set., NSUnderlyingError=0x7fce44155b00 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo=0x7fce441c31b0 (not displayed)}}}, NSLocalizedFailureReason=Failed to create SimDeviceSet at path /Users/eric/Library/Developer/Xcode/UserData/IB Support/Simulator Devices. You'll want to check the logs in ~/Library/Logs/CoreSimulator to see why creating the SimDeviceSet failed., NSLocalizedDescription=Failed to find a suitable device for the type SimDeviceType : com.apple.dt.Xcode.IBSimDeviceType.iPad-1x with runtime SimRuntime : 9.3 (13E230) - com.apple.CoreSimulator.SimRuntime.iOS-9-3}}}
This is an iPhone project, but uses a Universal component; I note that since the above says iPad.
When it fails, it opens up the Storyboard editor and it appears to be OK there; there's nothing that seems surprising at first glance.
XCode: Version 7.3.1 (7D1014)
Xamarin: Latest Stable; no updates available
Any insight or thoughts? Thanks!

loopback gets errors when slc run after installing socket.io

After I install socket.io, when I run the loopback API, it gives the following errors. I have tried to uninstall the socket.io or re-install the loopback but it still happens. BTW, I can access the API without any problems but it keeps to show so many errors in the console. So, How should I solve this errors?
INFO strong-agent v2.0.2 profiling app 'Xamarin_Node_API' pid '4076'
INFO strong-agent[4076] started profiling agent
INFO supervisor reporting metrics to `internal:`
supervisor running without clustering (unsupervised)
Web server listening at: http://localhost:3000
Browse your REST API at http://localhost:3000/explorer
Error: Cannot GET /socket.io/?EIO=3&transport=polling&t=635806057373451120-193&b
64=1
at raiseUrlNotFoundError (G:\Users\MM\Xamarin_Node_API\node_modules\loopback
\server\middleware\url-not-found.js:15:17)
at Layer.handle [as handle_request] (G:\Users\MM\Xamarin_Node_API\node_modul
es\loopback\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (G:\Users\MM\Xamarin_Node_API\node_modules\loopback\node_modu
les\express\lib\router\index.js:312:13)
at G:\Users\MM\Xamarin_Node_API\node_modules\loopback\node_modules\express\l
ib\router\index.js:280:7
at Function.process_params (G:\Users\MM\Xamarin_Node_API\node_modules\loopba
ck\node_modules\express\lib\router\index.js:330:12)
at next (G:\Users\MM\Xamarin_Node_API\node_modules\loopback\node_modules\exp
ress\lib\router\index.js:271:10)
at G:\Users\MM\Xamarin_Node_API\node_modules\loopback\node_modules\express\l
ib\router\index.js:618:15
at next (G:\Users\MM\Xamarin_Node_API\node_modules\loopback\node_modules\exp
ress\lib\router\index.js:256:14)
at Function.handle (G:\Users\MM\Xamarin_Node_API\node_modules\loopback\node_
modules\express\lib\router\index.js:176:3)
at router (G:\Users\MM\Xamarin_Node_API\node_modules\loopback\node_modules\e
xpress\lib\router\index.js:46:12)

Resources