Search code examples
google-fit

Google Fit on Android is working on debug but not on production


I am using History API to get user steps. It's working on debug but not on production.

I had created two certificates on OAuth 2.0 Client for both debug and production apps.

Unfortunately, I can get the steps in debug app, but not in the production signed app.

The app is not published for public yet. It's still in the internal testing. It's of course signed with production key.

When running the app, it shows Google authentication dialog so users can select Google account to be used for authentication. Upon selecting account, it shows error: com.google.android.gms.common.api.ApiException: 4: The user must be signed in to make this API call.

Any help please?


Solution

  • Hopefully ✓this answer saved my time.

    Basically, when your app using "App Signing", you need to check the SHA1 used by "App Signing", not the one mentioned on the official Google Fit documentation as release certificate.