I am getting very strange crash for some of my users. I am using Google Play Services and the Location service. The error is:
Not connected. Call connect() and wait for onConnected() to be called.
The relevant function in the code that it says is causing the crash is:
@Override
public void onConnected(Bundle bundle) {
if (debug) {
Toast.makeText(this, DateFormat.getDateTimeInstance().format(new Date()) + ": Connected.", Toast.LENGTH_SHORT).show();
}
// Request location updates using static settings
setUpLocationClientIfNeeded();
mLocationClient.requestLocationUpdates(mLocationRequest, this);<---- Crash here
}
The strange thing is, I can't replicate this crash in my own testing, so I can't figure out why this would be happening.
put mLocationClient.connect()
before your requestLocationUpdates
method. Worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With