We have this crash in crashlytics, the weird thing is it happens in onConnected()
callback when requesting location updates.
Code:
Maybe you should notice, GoogleApiClient.Builder
has a method setAccountName()
. You should invoke this method with your Google account name. I have tried, and succeeded. I used the following code:
if (mGoogleApiClient == null) {
mGoogleApiClient = new GoogleApiClient.Builder(context)
.addApi(LocationServices.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.setAccountName("李江涛")
.build();
}
if (mLocationRequest == null) {
mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(10000);
mLocationRequest.setFastestInterval(5000);
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
}