CommonStatusCodes

Kotlin|Java

public classCommonStatusCodes

Known direct subclasses
GoogleSignInStatusCodes

This class is deprecated.

UseCredential Manager for authentication orGoogle Identity Services for authorization.

ModuleInstallStatusCodes

Status code for module install APIs.


Common status codes that are often shared across API surfaces.

Summary

Constants

static final int

The client attempted to call a method from an API that failed to connect.

static final int

The result was canceled either due to client disconnect orcancel.

static final int

The connection was suspended while the call was in-flight.

static final int

The application is misconfigured.

static final int
ERROR = 13

The operation failed with no more detailed information.

static final int

An internal error occurred.

static final int

A blocking call was interrupted while waiting and did not run to completion.

static final int

The client attempted to connect to the service with an invalid account name specified.

static final int

A network error occurred.

static final int

The connection timed-out while attempting to re-connect.

static final int

The connection timed-out while waiting for Google Play services to update.

static final int

There was a non-DeadObjectExceptionRemoteException while calling a connected service.

static final int

Completing the operation requires some form of resolution.

static final int

This field is deprecated.

This case handled during connection, not during API requests.

static final int

This field is deprecated.

This case handled during connection, not during API requests.

static final int

The client attempted to connect to the service but the user is not signed in.

static final int

The operation was successful.

static final int

The operation was successful, but was used the device's cache.

static final int
TIMEOUT = 15

Timed out while awaiting the result.

Public methods

static @NonNullString
getStatusCodeString(int statusCode)

Returns untranslated debug string based on the current status code.

Constants

API_NOT_CONNECTED

public static final int API_NOT_CONNECTED = 17

The client attempted to call a method from an API that failed to connect. Possible reasons include:

  • The API previously failed to connect with a resolvable error, but the user declined the resolution.
  • The device does not support GmsCore.
  • The specific API cannot connect on this device.

CANCELED

public static final int CANCELED = 16

The result was canceled either due to client disconnect orcancel.

CONNECTION_SUSPENDED_DURING_CALL

public static final int CONNECTION_SUSPENDED_DURING_CALL = 20

The connection was suspended while the call was in-flight.

API calls will be failed with this status ifonServiceDisconnected is called by the Android platform before the call is completed.

This indicates that the underlying service was bound, sinceonServiceDisconnected should never be called unlessonServiceConnected was called first.

It is possible this failure could be resolved by retrying.

DEVELOPER_ERROR

public static final int DEVELOPER_ERROR = 10

The application is misconfigured. This error is not recoverable and will be treated as fatal. The developer should look at the logs after this to determine more actionable information.

ERROR

public static final int ERROR = 13

The operation failed with no more detailed information.

INTERNAL_ERROR

public static final int INTERNAL_ERROR = 8

An internal error occurred. Retrying should resolve the problem.

INTERRUPTED

public static final int INTERRUPTED = 14

A blocking call was interrupted while waiting and did not run to completion.

INVALID_ACCOUNT

public static final int INVALID_ACCOUNT = 5

The client attempted to connect to the service with an invalid account name specified.

NETWORK_ERROR

public static final int NETWORK_ERROR = 7

A network error occurred. Retrying should resolve the problem.

RECONNECTION_TIMED_OUT

public static final int RECONNECTION_TIMED_OUT = 22

The connection timed-out while attempting to re-connect.

This failure indicates a connection to Google Play services was successfully established, however it was disconnected for some reason (for example, Google Play services crashed), and re-connecting took longer than expected.

Any API calls failed with this status would have been initiated after the connection was disconnected.

RECONNECTION_TIMED_OUT_DURING_UPDATE

public static final int RECONNECTION_TIMED_OUT_DURING_UPDATE = 21

The connection timed-out while waiting for Google Play services to update.

This failure indicates a connection to Google Play services was successfully established, however it was disconnected because Google Play services was updated, and the update took far longer than expected.

Any API calls failed with this status would have been initiated after the disconnection for the update.

REMOTE_EXCEPTION

public static final int REMOTE_EXCEPTION = 19

There was a non-DeadObjectExceptionRemoteException while calling a connected service.

This signifies that an API was able to connect to Google Play services and received an instance, but that when calling an individual method, aRemoteException was thrown.

Note that the exception wouldnot be aDeadObjectException, which indicates that the binding has died (for example if the remote process died). This is becauseDeadObjectExceptions are handled by the connection management infrastructure ofGoogleApi.

If this is encountered during an API call for an API that uses the Google Play servicesServiceBroker (most do), it isafter a bound service is successfully received from theServiceBroker.

RESOLUTION_REQUIRED

public static final int RESOLUTION_REQUIRED = 6

Completing the operation requires some form of resolution. A resolution will be available to be started withstartResolutionForResult. If the result returned isRESULT_OK, then further attempts should either complete or continue on to the next issue that needs to be resolved.

SIGN_IN_REQUIRED

public static final int SIGN_IN_REQUIRED = 4

The client attempted to connect to the service but the user is not signed in. The client may choose to continue without using the API. Alternately, ifhasResolution returns true the client may callstartResolutionForResult to prompt the user to sign in. After the sign in activity returns withRESULT_OK further attempts should succeed.

SUCCESS

public static final int SUCCESS = 0

The operation was successful.

SUCCESS_CACHE

public static final int SUCCESS_CACHE = -1

The operation was successful, but was used the device's cache. If this is a write, the data will be written when the device is online; errors will be written to the logs. If this is a read, the data was read from a device cache and may be stale.

TIMEOUT

public static final int TIMEOUT = 15

Timed out while awaiting the result.

Public methods

getStatusCodeString

public static @NonNullString getStatusCodeString(int statusCode)

Returns untranslated debug string based on the current status code.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-03-17 UTC.