FitnessSensorService not being started by Android OS

I am attempting to write a fitness application that incorporates Google Fit. The app is related to a wearable that tracks basic step count. In our test harness in Android Studio we have the following related service that is started automatically by the Android OS.

This does start the service which is then used by the app in other code to send step counts to the Google Fit app (FitnessSensorService). However, attempting to start the same service from the Unity App results in the service not being started.

After poking around a few days, attempting to do what I can to rule out various components, even going as far as generating a Unity-Android Studio project and ripping out everything but a few key files; I am still at a lost as to why the service is not being started.

My question: Is there something with Unity that prevents OS-started services from running? Or something incompatible between Unity and the way the FitnessSensorService works?

1 Reply

So it turns out that testing the FitnessSensorService in the test app caused some interference when attempting to start a similar service from the Unity app (with no errors of course). I had to uninstall the test app and restart my phone to completely remove its service. After that the service started by the Untiy app was working as expected.