I have created an app that connects to Google Drive via this code:
googleApiClient = new GoogleApiClient.Builder(this)
.addApi(Drive.API).addScope(Drive.SCOPE_FILE)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this).build();
googleApiClient.connect();
This code works on my tablet (Samsung Galaxy Tablet 2, with 4.4.2 running on it), however when I try running this same code on either a Nexus 5 with 5.0.1 or a Galaxy S5 with 4.4.4, connecting to Google Drive crashes every time.
I do one initialization of the googleApiClient object, and one call to connect, but for some reason I keep getting this error:
04-13 15:27:44.563: E/AndroidRuntime(5402): java.lang.IllegalStateException: Client must be connected
Both phones have 3G and Wifi access, and the tablet just has Wifi access. I am calling connect to Google Drive, but for some reason I keep getting this error.
Has anyone ever encountered this issue before?