# IntegrityErrorCode


```
public annotation IntegrityErrorCode
```

<br />

*** ** * ** ***

Error codes for Integrity API.

## Summary

| ### Constants |
|---|---|
| `static final int` | [API_NOT_AVAILABLE](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#API_NOT_AVAILABLE)` = -1` Integrity API is not available. |
| `static final int` | [APP_NOT_INSTALLED](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#APP_NOT_INSTALLED)` = -5` The calling app is not installed. |
| `static final int` | [APP_UID_MISMATCH](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#APP_UID_MISMATCH)` = -7` The calling app UID (user id) does not match the one from Package Manager. |
| `static final int` | [CANNOT_BIND_TO_SERVICE](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#CANNOT_BIND_TO_SERVICE)` = -9` Binding to the service in the Play Store has failed. |
| `static final int` | [CLIENT_TRANSIENT_ERROR](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#CLIENT_TRANSIENT_ERROR)` = -17` There was a transient error in the client device. |
| `static final int` | [CLOUD_PROJECT_NUMBER_IS_INVALID](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#CLOUD_PROJECT_NUMBER_IS_INVALID)` = -16` The provided cloud project number is invalid. |
| `static final int` | [GOOGLE_SERVER_UNAVAILABLE](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#GOOGLE_SERVER_UNAVAILABLE)` = -12` Unknown internal Google server error. |
| `static final int` | [INTERNAL_ERROR](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#INTERNAL_ERROR)` = -100` Unknown internal error. |
| `static final int` | [NETWORK_ERROR](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#NETWORK_ERROR)` = -3` No available network is found. |
| `static final int` | [NONCE_IS_NOT_BASE64](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#NONCE_IS_NOT_BASE64)` = -13` Nonce is not encoded as a base64 web-safe no-wrap string. |
| `static final int` | [NONCE_TOO_LONG](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#NONCE_TOO_LONG)` = -11` Nonce length is too long. |
| `static final int` | [NONCE_TOO_SHORT](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#NONCE_TOO_SHORT)` = -10` Nonce length is too short. |
| `static final int` | [NO_ERROR](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#NO_ERROR)` = 0` |
| `static final int` | [PLAY_SERVICES_NOT_FOUND](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#PLAY_SERVICES_NOT_FOUND)` = -6` Play Services is not available or version is too old. |
| `static final int` | [PLAY_SERVICES_VERSION_OUTDATED](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#PLAY_SERVICES_VERSION_OUTDATED)` = -15` Play Services needs to be updated. |
| `static final int` | [PLAY_STORE_ACCOUNT_NOT_FOUND](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#PLAY_STORE_ACCOUNT_NOT_FOUND)` = -4` No Play Store account is found on device. |
| `static final int` | [PLAY_STORE_NOT_FOUND](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#PLAY_STORE_NOT_FOUND)` = -2` No Play Store app is found on device or not official version is installed. |
| `static final int` | [PLAY_STORE_VERSION_OUTDATED](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#PLAY_STORE_VERSION_OUTDATED)` = -14` The Play Store needs to be updated. |
| `static final int` | [TOO_MANY_REQUESTS](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode#TOO_MANY_REQUESTS)` = -8` The calling app has made too many requests to the API and has been throttled, or your app has exceeded its daily request quota. |

## Constants

### API_NOT_AVAILABLE

```
public static final int API_NOT_AVAILABLE = -1
```

Integrity API is not available.

Integrity API is not enabled, or the Play Store version might be old.

Recommended actions:

- Make sure that Integrity API is enabled in Google Play Console.
- Ask the user to update Play Store.  

### APP_NOT_INSTALLED

```
public static final int APP_NOT_INSTALLED = -5
```

The calling app is not installed.

Something is wrong (possibly an attack). Non-actionable.  

### APP_UID_MISMATCH

```
public static final int APP_UID_MISMATCH = -7
```

The calling app UID (user id) does not match the one from Package Manager.

Something is wrong (possibly an attack). Non-actionable.  

### CANNOT_BIND_TO_SERVICE

```
public static final int CANNOT_BIND_TO_SERVICE = -9
```

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 Play Store.  

### CLIENT_TRANSIENT_ERROR

```
public static final int CLIENT_TRANSIENT_ERROR = -17
```

There was a transient error in the client device.

Retry with an exponential backoff.

Introduced in Integrity Play Core version 1.1.0 (prior versions returned a token with empty Device Integrity Verdict). If the error persists after a few retries, you should assume that the device has failed integrity checks and act accordingly.  

### CLOUD_PROJECT_NUMBER_IS_INVALID

```
public static final int CLOUD_PROJECT_NUMBER_IS_INVALID = -16
```

The provided cloud project number is invalid.

Use the cloud project number which can be found in Project info in your Google Cloud Console for the cloud project where Play Integrity API is enabled.  

### GOOGLE_SERVER_UNAVAILABLE

```
public static final int GOOGLE_SERVER_UNAVAILABLE = -12
```

Unknown internal Google server error.

Retry with an exponential backoff. Consider filing a bug if fails consistently.  

### INTERNAL_ERROR

```
public static final int INTERNAL_ERROR = -100
```

Unknown internal error.

Retry with an exponential backoff. Consider filing a bug if fails consistently.  

### NETWORK_ERROR

```
public static final int NETWORK_ERROR = -3
```

No available network is found.

Recommended actions:

- Ask the user to check and enable their network connection.
- For a guided user experience that helps the user to establish a network connection, you can show either [GET_INTEGRITY](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityDialogTypeCode#GET_INTEGRITY) or [GET_STRONG_INTEGRITY](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityDialogTypeCode#GET_STRONG_INTEGRITY) dialog.  

### NONCE_IS_NOT_BASE64

```
public static final int NONCE_IS_NOT_BASE64 = -13
```

Nonce is not encoded as a base64 web-safe no-wrap string.

Retry with correct nonce format.  

### NONCE_TOO_LONG

```
public static final int NONCE_TOO_LONG = -11
```

Nonce length is too long. The nonce must be less than 500 bytes before base64 encoding.

Retry with a shorter nonce.  

### NONCE_TOO_SHORT

```
public static final int NONCE_TOO_SHORT = -10
```

Nonce length is too short. The nonce must be a minimum of 16 bytes (before base64 encoding) to allow for a better security.

Retry with a longer nonce.  

### NO_ERROR

```
public static final int NO_ERROR = 0
```  

### PLAY_SERVICES_NOT_FOUND

```
public static final int PLAY_SERVICES_NOT_FOUND = -6
```

Play Services is not available or version is too old.

Recommended actions:

- Ask the user to install or update Play Services.
- For a guided user experience that helps the user to enable, install or update Play Services, you can show either [GET_INTEGRITY](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityDialogTypeCode#GET_INTEGRITY) or [GET_STRONG_INTEGRITY](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityDialogTypeCode#GET_STRONG_INTEGRITY) dialog.  

### PLAY_SERVICES_VERSION_OUTDATED

```
public static final int PLAY_SERVICES_VERSION_OUTDATED = -15
```

Play Services needs to be updated.

Recommended actions:

- Ask the user to update Google Play Services.
- For a guided user experience that helps the user to update Play Services, you can show either [GET_INTEGRITY](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityDialogTypeCode#GET_INTEGRITY) or [GET_STRONG_INTEGRITY](https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityDialogTypeCode#GET_STRONG_INTEGRITY) dialog.  

### PLAY_STORE_ACCOUNT_NOT_FOUND

```
public static final int PLAY_STORE_ACCOUNT_NOT_FOUND = -4
```

No Play Store account is found on 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 authenticate in Play Store.  

### PLAY_STORE_NOT_FOUND

```
public static final int PLAY_STORE_NOT_FOUND = -2
```

No Play Store app is found on device or not official version is installed.

Ask the user to install an official and recent version of Play Store.  

### PLAY_STORE_VERSION_OUTDATED

```
public static final int PLAY_STORE_VERSION_OUTDATED = -14
```

The Play Store needs to be updated.

Ask the user to update the Google Play Store.  

### TOO_MANY_REQUESTS

```
public static final int TOO_MANY_REQUESTS = -8
```

The calling app has made too many requests to the API and has been throttled, or your app has exceeded its daily request quota.

Retry with an exponential backoff. Request an increase to your daily request quota if you're at your daily request limit.