0

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?

Christina
  • 57
  • 2
  • 8
  • Check if you have the same version of Google Play Services on both devices. And what is the version of GooPlaSvcs lib in you IDE. Do you use Eclipse or Studio? – seanpj Apr 13 '15 at 22:12
  • Tablet is Google Play Services version 6.7.76, phone is 7.0.99. Using Eclipse, and I'm using Google Play Services revision 22 in Eclipse. – Christina Apr 13 '15 at 23:44
  • Did you get anywhere with the suggestion? – seanpj Apr 26 '15 at 18:20

1 Answers1

1

I believe your problem stems from a mismatch in Google Play Services versions. I think, the 7.0.+ version on your phone needs revision 23 in your IDE. Try to run SDK Manager and download rev 23 or higher. Your tablet will probably update to 7.00.+ when Google decides the time is right. But rev. 23 (or higher) should be compatible with everything 7.00 and lower. I can't be more specific here, since I am on Android Studio.

Good Luck

seanpj
  • 6,735
  • 2
  • 33
  • 54