GoogleApiClient Calling connect() while still conn

2020-05-01 08:41发布

问题:

1) Calling connect() while still connected, missing disconnect().This error occurs in following scenario,

  1. Switch off Wifi and launch my App First time.

  2. I try to connect GoogleAPiClient onCreate() of Activity

  3. Got Error dialog, Network Error:A data connection is required to connect to GoogleApiClient.

  4. So Switch ON WIFI, again open my App.

  5. Got connect() while still connected, missing disconnect() error.

From my debugging I found,no GoogleApiClient connection callback methods are called when this occurs.

Note : This error not occurs, if I remove my google account from my device and add again. Also I used old version of Google play services.Is it affects anything.(As I used LocationClient API in my app I cant update to new Google play services, because it is updated to LocationServices API)

回答1:

Poblem solved, when all data from Google Play services app was deleted. I think, problem is when play services remember every application which have succesfull authorization. But your application is not succesfully authorizated, or is authorizated in early version.