Search code examples
androidgitandroid-studio-2.2google-fitgoogle-developers-console

Google API connection fails after cloning from Git to another environment


We are a team of two trying to build an android app that uses the Google Fit API. The problem we're running into is that only the computer that originally built the project is able to successfully run the app on a device and connected it to Google Fit.

We can get the app working fine on one computer, where it will prompt the user for permission and also the Google account to use and then it will successfully connect and pull the steps data.

Then we will create a git repository with this working project and clone it to another computer. But the problem is when we then try to run that project from the second environment the connection always fails. It always returns statusCode=CANCELED:

Google Play services connection failed. Cause: ConnectionResult{statusCode=CANCELED, resolution=null, message=null}

The device just says the result.getErrorMessage() is null which isn't really telling us much.

We're trying to figure out what part of checking this app in and trying to then pull and work on it on another machine causes this. Is there some kind of log in key or setting, which is not versioned for apps, that need to be transferred/set/configured?

We've built it and gotten it working on two different starting environments, but pulling it from any other computer just doesn't build into a working app. Any thoughts would be greatly appreciated.


Solution

  • Not sure why it was voted down but after some juggling of different phrases and looking up similar problems for other APIs we finally found our solution elsewhere so I'll leave it here.

    We had to copy over the debug.keystore file from the originating computer to any other computer that wants to work on it. The file will be in the computer's user directory, somewhere around C:\Users\Owner\.android, which isn't versioned with the project but necessary to authenticate with google apis apparently.