# FirebaseMlException


```
class FirebaseMlException : FirebaseException
```

<br />

|---|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/kotlin/java/lang/Exception.html) |||
|   |   | ↳ | [com.google.firebase.FirebaseException](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/FirebaseException) ||
|   |   |   | ↳ | [com.google.firebase.ml.modeldownloader.FirebaseMlException](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException) |

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Represents an Exception resulting from an operation on a `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseModelDownloader`. Error mappings should remain consistent with the original firebase_ml_sdk whenever possible.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntDef.html(value = ) @https://developer.android.com/reference/kotlin/java/lang/annotation/Retention.html(value = RetentionPolicy.CLASS) annotation https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException.Code` **This annotation is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#ABORTED() = 10` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#ALREADY_EXISTS() = 6` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#CANCELLED() = 1` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#DEADLINE_EXCEEDED() = 4` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#DOWNLOAD_URL_EXPIRED() = 121` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#FAILED_PRECONDITION() = 9` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#INTERNAL() = 13` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#INVALID_ARGUMENT() = 3` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#MODEL_HASH_MISMATCH() = 102` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#NOT_ENOUGH_SPACE() = 101` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#NOT_FOUND() = 5` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#NO_NETWORK_CONNECTION() = 17` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#OUT_OF_RANGE() = 11` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#PERMISSION_DENIED() = 7` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#RESOURCE_EXHAUSTED() = 8` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#UNAUTHENTICATED() = 16` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#UNAVAILABLE() = 14` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#UNIMPLEMENTED() = 12` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#UNKNOWN() = 2` **This property is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `@https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException.Code https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ml/modeldownloader/FirebaseMlException#code()` |

| ### Inherited functions |
|---|
| From [java.lang.Throwable](https://developer.android.com/reference/kotlin/java/lang/Throwable.html) |---|---| | `synchronized https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/add-suppressed.html(exception: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!)` | | `synchronized https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/fill-in-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-cause.html()` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-localized-message.html()` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-message.html()` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/java/lang/StackTraceElement.html!>!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!>!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-suppressed.html()` | | `synchronized https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/init-cause.html(cause: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!)` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/print-stack-trace.html()` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/set-stack-trace.html(stackTrace: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/java/lang/StackTraceElement.html!>!)` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/to-string.html()` | |

## Constants

### ABORTED

```
const val ABORTED = 10: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

The operation was aborted, typically due to a concurrency issue like transaction aborts, etc.

### ALREADY_EXISTS

```
const val ALREADY_EXISTS = 6: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Some resource that we attempted to create already exists.

### CANCELLED

```
const val CANCELLED = 1: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

The operation was cancelled (typically by the caller).

### DEADLINE_EXCEEDED

```
const val DEADLINE_EXCEEDED = 4: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire.

### DOWNLOAD_URL_EXPIRED

```
const val DOWNLOAD_URL_EXPIRED = 121: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

The download URL expired before download could complete. Usually, multiple download attempts will be performed before this is returned.

### FAILED_PRECONDITION

```
const val FAILED_PRECONDITION = 9: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Operation was rejected because the system is not in a state required for the operation's execution.

### INTERNAL

```
const val INTERNAL = 13: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Internal errors. Means some invariant expected by underlying system has been broken. If you see one of these errors, something is very broken.

### INVALID_ARGUMENT

```
const val INVALID_ARGUMENT = 3: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Client specified an invalid argument. Note that this differs from `FAILED_PRECONDITION
`. `INVALID_ARGUMENT` indicates arguments that are problematic regardless of the state of the system (for example, an invalid field name).

### MODEL_HASH_MISMATCH

```
const val MODEL_HASH_MISMATCH = 102: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

The downloaded model's hash doesn't match the expected value.

### NOT_ENOUGH_SPACE

```
const val NOT_ENOUGH_SPACE = 101: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

There is not enough space left on the device.

### NOT_FOUND

```
const val NOT_FOUND = 5: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Some requested resource was not found.

### NO_NETWORK_CONNECTION

```
const val NO_NETWORK_CONNECTION = 17: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

There is no network connection.

### OUT_OF_RANGE

```
const val OUT_OF_RANGE = 11: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Operation was attempted past the valid range.

### PERMISSION_DENIED

```
const val PERMISSION_DENIED = 7: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

The caller does not have permission to execute the specified operation.

### RESOURCE_EXHAUSTED

```
const val RESOURCE_EXHAUSTED = 8: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space.

### UNAUTHENTICATED

```
const val UNAUTHENTICATED = 16: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

The request does not have valid authentication credentials for the operation.

### UNAVAILABLE

```
const val UNAVAILABLE = 14: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.

In ML Model Downloader, this error is mostly about the models being not available yet.

### UNIMPLEMENTED

```
const val UNIMPLEMENTED = 12: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Operation is not implemented or not supported/enabled.

### UNKNOWN

```
const val UNKNOWN = 2: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Unknown error or an error from a different error domain.

## Public properties

### code

```
@FirebaseMlException.Code
val code: Int
```