This answer relates only to devices, not to emulators. Converted to "community wiki" because it does provide useful info for devices.
The error is one of the normal ConnectionResult
errors from Google Play Services.
You need to resolve that error, by displaying the appropriate error dialog for that ConnectionResult
. Here is some sample code from the online docs:
.
/** Creates a dialog for the Google Play Services error. */
private void showErrorDialog(int errorCode)
{
// DialogFragment.show() will take care of adding the fragment
// in a transaction. We also want to remove any currently showing
// dialog, so make our own transaction and take care of that here.
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev =
getSupportFragmentManager()
.findFragmentByTag(GooglePlayDialogFragment.DIALOG_ERROR);
if (prev != null)
{
ft.remove(prev);
}
ft.addToBackStack(null);
// Create a fragment for the error dialog
GooglePlayDialogFragment dialogFragment = new GooglePlayDialogFragment();
// Pass the error that should be displayed
Bundle args = new Bundle();
args.putInt(GooglePlayDialogFragment.DIALOG_ERROR, errorCode);
dialogFragment.setArguments(args);
dialogFragment.show(ft, GooglePlayDialogFragment.DIALOG_ERROR);
}
Internally the GooglePlayDialogFragment
handles many of the upgrade errors, directing the user to the Play Store to update the SDK.