This page lists some common error codes, what they represent, and how your app or game can respond to them.
Common error codes
The following table lists the errors that the API can return on any platform, along with suggested next steps.
Error code | Description | Your action |
---|---|---|
API_NOT_AVAILABLE |
Integrity API is not available. Integrity API is not enabled, or the Play Store version might be old. | 1) Make sure that Integrity API is enabled in Google Play Console. 2) Ask the user to update Google Play Store. |
NETWORK_ERROR |
No available network was found. | Ask the user to check for network connectivity. |
PLAY_STORE_NOT_FOUND |
No official Play Store app was found on the device. | Ask the user to install or enable Google Play Store. |
PLAY_STORE_VERSION_OUTDATED |
Play Store app needs to be updated. | Ask the user to update Google Play Store. |
PLAY_STORE_ACCOUNT_NOT_FOUND |
No Play Store account is found on the device. Note that the Play Integrity API now supports unauthenticated requests. This error code is used only for older Play Store versions that lack support. | Ask the user to sign in to the Google Play Store. |
CANNOT_BIND_TO_SERVICE |
Binding to the service in the Play Store has failed. This can be due to having an old Play Store version installed on the device. | Ask the user to update the Google Play Store. |
APP_NOT_INSTALLED |
The calling app is not installed. | Something is wrong; possibly an attack. Non-actionable. |
PLAY_SERVICES_NOT_FOUND |
Play services is unavailable or needs to be updated. | Ask the user to install or enable Play Services. |
PLAY_SERVICES_VERSION_OUTDATED |
Play services needs to be updated. | Ask the user to update Google Play services. |
TOO_MANY_REQUESTS |
The calling app is making too many requests to the API and has been throttled. | Retry with an exponential backoff. |
GOOGLE_SERVER_UNAVAILABLE |
Unknown internal Google server error. | Retry with an exponential backoff. |
CLIENT_TRANSIENT_ERROR |
Transient error has occurred on the client device. Supported as of library version 1.1.0 for the Kotlin and Java programming languages. | Retry with an exponential backoff. |
INTERNAL_ERROR |
Unknown internal error. | Retry with an exponential backoff. |
NONCE_TOO_SHORT |
Nonce length is too short. The nonce must be a minimum of 16 bytes (before base64 encoding). | Retry with a longer nonce. |
NONCE_TOO_LONG |
Nonce length is too long. The nonce must be less than 500 bytes before base64 encoding. | Retry with a shorter nonce. |
NONCE_IS_NOT_BASE64 |
Nonce is not of base64 web-safe no-wrap form. | Retry with correct nonce format. |
CLOUD_PROJECT_NUMBER_IS_INVALID |
The provided cloud project number is invalid. | Use the cloud project number of your cloud project where the Play Integrity API is enabled. |
APP_UID_MISMATCH |
The calling app UID (user ID) does not match the one from Package Manager. | Something is wrong; possibly an attack. Non-actionable. |
Native-specific error codes
The INTEGRITY_ prefix is prepended to native error codes to avoid potential naming conflicts. Apart from the error codes listed above, the native API also includes the following error codes:
Error code | Description | Your action |
---|---|---|
INTEGRITY_INITIALIZATION_NEEDED |
IntegrityManager is not initialized. | Invoke IntegrityManager_init() first. |
INTEGRITY_INITIALIZATION_FAILED |
There was an error initializing the Integrity API. | Retry with an exponential backoff. Consider filing a bug. |
INTEGRITY_INVALID_ARGUMENT |
Invalid argument passed to the Integrity API. | Retry with correct argument. |
Retry logic on error
An app should retry API calls in case of certain error codes. Review all error codes, and check that the application retries when necessary with exponential backoff. The recommended retry strategy is:
- After the first failure, start with an initial delay of 5 seconds before retrying.
- Retry for a total of three attempts, increasing the delay exponentially each time (10s, 20s).
While performing these retry attempts, check for a network connection and don't overload the device.
If you continue to see errors after 3 attempts, treat the outcome as if the client has failed all integrity checks. The error could be for several reasons, including (but not limited to): an overloaded device, network connection issues, or an attempt by a malicious party.