Search code examples
androidandroid-studiogoogle-apigoogle-fitgoogle-fit-sdk

exception while connecting to google play services null


I'm trying to implement google fit API using https://github.com/googlesamples/android-fit with android studio but i get the following error:

 exception while connecting to google play services null

I have already set up OAUTH in the google developer console by providing the package name, and SSH for my builds. and I have also enabled the API.

I can't seem to figure out what else I need to do in order to successfully connect to Google play...


Solution

  • I havent used Android-fit, but did used Google play Location services in my project. So steps would be to first check if play services exists. If the method returns true, then connect to the service. And then implement your logic in the on-connection established callback method. If they dont exist, redirect the user to fetch them from playstore. Assuming that device doesnt has google play store, then redirect them to the Web Url to download it.