# ExportException

Artifact: [androidx.media3:media3-transformer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/transformer/ExportException.java+class:androidx.media3.transformer.ExportException)

*** ** * ** ***


```
@UnstableApi
public final class ExportException extends Exception
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [kotlin.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) |||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) ||
|   |   | ↳ | [androidx.media3.transformer.ExportException](https://developer.android.com/reference/androidx/media3/transformer/ExportException) |

*** ** * ** ***

Thrown when a non-locally recoverable export failure occurs.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/media3/transformer/ExportException.CodecInfo` The `https://developer.android.com/reference/androidx/media3/transformer/Codec` details. |
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/androidx/annotation/IntDef(open = true, value = ) public annotation https://developer.android.com/reference/androidx/media3/transformer/ExportException.ErrorCode` Error codes that identify causes of `https://developer.android.com/reference/androidx/media3/transformer/Transformer` errors. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_AUDIO_PROCESSING_FAILED() = 6001` Caused by an audio processing failure. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_DECODER_INIT_FAILED() = 3001` Caused by a decoder initialization failure. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_DECODING_FAILED() = 3002` Caused by a failure while trying to decode media samples. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_DECODING_FORMAT_UNSUPPORTED() = 3003` Caused by trying to decode content whose format is not supported. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_ENCODER_INIT_FAILED() = 4001` Caused by an encoder initialization failure. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_ENCODING_FAILED() = 4002` Caused by a failure while trying to encode media samples. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_ENCODING_FORMAT_UNSUPPORTED() = 4003` Caused by trying to encode content whose format is not supported. \* |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_FAILED_RUNTIME_CHECK() = 1001` Caused by a failed runtime check. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_IO_BAD_HTTP_STATUS() = 2004` Caused by an HTTP server returning an unexpected HTTP response status code. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED() = 2007` Caused by the `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` trying to access cleartext HTTP traffic (meaning http:// rather than https://) when the app's Network Security Configuration does not permit it. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_IO_FILE_NOT_FOUND() = 2005` Caused by a non-existent file. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE() = 2003` Caused by a server returning a resource with an invalid "Content-Type" HTTP header value. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_IO_NETWORK_CONNECTION_FAILED() = 2001` Caused by a network connection failure. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT() = 2002` Caused by a network timeout, meaning the server is taking too long to fulfill a request. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_IO_NO_PERMISSION() = 2006` Caused by lack of permission to perform an IO operation. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE() = 2008` Caused by reading data out of the data bound. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_IO_UNSPECIFIED() = 2000` Caused by an Input/Output error which could not be identified. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_MUXING_APPEND() = 7003` Caused by mismatching formats in MuxerWrapper. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_MUXING_FAILED() = 7001` Caused by a failure while muxing media samples. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_MUXING_TIMEOUT() = 7002` Caused by a timeout while muxing media samples. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_UNSPECIFIED() = 1000` Caused by an error whose cause could not be identified. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED() = 5001` Caused by a video frame processing failure. |

| ### Public fields |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/transformer/ExportException.CodecInfo` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#codecInfo()` The `https://developer.android.com/reference/androidx/media3/transformer/ExportException.CodecInfo` for codec related exceptions, or `null` if the exception is not codec related. |
| `final int` | `@https://developer.android.com/reference/androidx/media3/transformer/ExportException.ErrorCode https://developer.android.com/reference/androidx/media3/transformer/ExportException#errorCode()` An error code which identifies the cause of the export failure. |
| `final long` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#timestampMs()` The value of `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()` when this exception was created. |

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/media3/transformer/ExportException` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#createForAssetLoader(java.lang.Throwable,int)(https://developer.android.com/reference/java/lang/Throwable.html cause, int errorCode)` Creates an instance for an `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` related exception. |
| `static https://developer.android.com/reference/androidx/media3/transformer/ExportException` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#createForAudioProcessing(androidx.media3.common.audio.AudioProcessor.UnhandledAudioFormatException,java.lang.String)( https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.UnhandledAudioFormatException exception, https://developer.android.com/reference/java/lang/String.html details )` Creates an instance for an audio processing related exception. |
| `static https://developer.android.com/reference/androidx/media3/transformer/ExportException` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#createForCodec(java.lang.Throwable,int,androidx.media3.transformer.ExportException.CodecInfo)( https://developer.android.com/reference/java/lang/Throwable.html cause, @https://developer.android.com/reference/androidx/media3/transformer/ExportException.ErrorCode int errorCode, https://developer.android.com/reference/androidx/media3/transformer/ExportException.CodecInfo codecInfo )` Creates an instance for a `https://developer.android.com/reference/androidx/media3/transformer/Codec` related exception. |
| `static https://developer.android.com/reference/androidx/media3/transformer/ExportException` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#createForUnexpected(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable.html cause)` Creates an instance for an unexpected exception. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#errorInfoEquals(androidx.media3.transformer.ExportException)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/transformer/ExportException other)` Returns whether the error data associated to this exception equals the error data associated to `other`. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#getErrorCodeName()()` Equivalent to `https://developer.android.com/reference/androidx/media3/transformer/ExportException#getErrorCodeName(int)`. |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/transformer/ExportException#getErrorCodeName(int)(@https://developer.android.com/reference/androidx/media3/transformer/ExportException.ErrorCode int errorCode)` Returns the name of a given `errorCode`. |

### Inherited methods

From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) `synchronized final void` `https://developer.android.com/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable.html exception)` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#fillInStackTrace()()` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#getCause()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getLocalizedMessage()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getMessage()()` `StackTraceElement[]` `https://developer.android.com/reference/java/lang/Throwable.html#getStackTrace()()` `synchronized final Throwable[]` `https://developer.android.com/reference/java/lang/Throwable.html#getSuppressed()()` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable.html cause)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace()()` `void` `https://developer.android.com/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[])(StackTraceElement[] stackTrace)` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#toString()()`

## Constants

### ERROR_CODE_AUDIO_PROCESSING_FAILED

```
public static final int ERROR_CODE_AUDIO_PROCESSING_FAILED = 6001
```

Caused by an audio processing failure.

### ERROR_CODE_DECODER_INIT_FAILED

```
public static final int ERROR_CODE_DECODER_INIT_FAILED = 3001
```

Caused by a decoder initialization failure.

### ERROR_CODE_DECODING_FAILED

```
public static final int ERROR_CODE_DECODING_FAILED = 3002
```

Caused by a failure while trying to decode media samples.

### ERROR_CODE_DECODING_FORMAT_UNSUPPORTED

```
public static final int ERROR_CODE_DECODING_FORMAT_UNSUPPORTED = 3003
```

Caused by trying to decode content whose format is not supported.

### ERROR_CODE_ENCODER_INIT_FAILED

```
public static final int ERROR_CODE_ENCODER_INIT_FAILED = 4001
```

Caused by an encoder initialization failure.

### ERROR_CODE_ENCODING_FAILED

```
public static final int ERROR_CODE_ENCODING_FAILED = 4002
```

Caused by a failure while trying to encode media samples.

### ERROR_CODE_ENCODING_FORMAT_UNSUPPORTED

```
public static final int ERROR_CODE_ENCODING_FORMAT_UNSUPPORTED = 4003
```

Caused by trying to encode content whose format is not supported. \*

Supported output formats are limited by the `https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory` available.

### ERROR_CODE_FAILED_RUNTIME_CHECK

```
public static final int ERROR_CODE_FAILED_RUNTIME_CHECK = 1001
```

Caused by a failed runtime check.

This can happen when transformer reaches an invalid state.

### ERROR_CODE_IO_BAD_HTTP_STATUS

```
public static final int ERROR_CODE_IO_BAD_HTTP_STATUS = 2004
```

Caused by an HTTP server returning an unexpected HTTP response status code.

### ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED

```
public static final int ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED = 2007
```

Caused by the `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` trying to access cleartext HTTP traffic (meaning http:// rather than https://) when the app's Network Security Configuration does not permit it.

### ERROR_CODE_IO_FILE_NOT_FOUND

```
public static final int ERROR_CODE_IO_FILE_NOT_FOUND = 2005
```

Caused by a non-existent file.

### ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE

```
public static final int ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE = 2003
```

Caused by a server returning a resource with an invalid "Content-Type" HTTP header value.

For example, this can happen when the `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` is expecting a piece of media, but the server returns a paywall HTML page, with content type "text/html".

### ERROR_CODE_IO_NETWORK_CONNECTION_FAILED

```
public static final int ERROR_CODE_IO_NETWORK_CONNECTION_FAILED = 2001
```

Caused by a network connection failure.

The following is a non-exhaustive list of possible reasons:

- There is no network connectivity.
- The URL's domain is misspelled or does not exist.
- The target host is unreachable.
- The server unexpectedly closes the connection.

### ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT

```
public static final int ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT = 2002
```

Caused by a network timeout, meaning the server is taking too long to fulfill a request.

### ERROR_CODE_IO_NO_PERMISSION

```
public static final int ERROR_CODE_IO_NO_PERMISSION = 2006
```

Caused by lack of permission to perform an IO operation. For example, lack of permission to access internet or external storage.

### ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE

```
public static final int ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE = 2008
```

Caused by reading data out of the data bound.

### ERROR_CODE_IO_UNSPECIFIED

```
public static final int ERROR_CODE_IO_UNSPECIFIED = 2000
```

Caused by an Input/Output error which could not be identified.

### ERROR_CODE_MUXING_APPEND

```
public static final int ERROR_CODE_MUXING_APPEND = 7003
```

Caused by mismatching formats in MuxerWrapper.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/MuxerWrapper.AppendTrackFormatException` |   |

### ERROR_CODE_MUXING_FAILED

```
public static final int ERROR_CODE_MUXING_FAILED = 7001
```

Caused by a failure while muxing media samples.

### ERROR_CODE_MUXING_TIMEOUT

```
public static final int ERROR_CODE_MUXING_TIMEOUT = 7002
```

Caused by a timeout while muxing media samples.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/Transformer.Builder#setMaxDelayBetweenMuxerSamplesMs(long)` |   |

### ERROR_CODE_UNSPECIFIED

```
public static final int ERROR_CODE_UNSPECIFIED = 1000
```

Caused by an error whose cause could not be identified.

### ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED

```
public static final int ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED = 5001
```

Caused by a video frame processing failure.

## Public fields

### codecInfo

```
public final @Nullable ExportException.CodecInfo codecInfo
```

The `https://developer.android.com/reference/androidx/media3/transformer/ExportException.CodecInfo` for codec related exceptions, or `null` if the exception is not codec related.

### errorCode

```
@ExportException.ErrorCode
public final int errorCode
```

An error code which identifies the cause of the export failure.

### timestampMs

```
public final long timestampMs
```

The value of `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()` when this exception was created.

## Public methods

### createForAssetLoader

```
public static ExportException createForAssetLoader(Throwable cause, int errorCode)
```

Creates an instance for an `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` related exception.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Throwable.html cause` | The cause of the failure. |
| `int errorCode` | See `https://developer.android.com/reference/androidx/media3/transformer/ExportException#errorCode()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/ExportException` | The created instance. |

### createForAudioProcessing

```
public static ExportException createForAudioProcessing(
    AudioProcessor.UnhandledAudioFormatException exception,
    String details
)
```

Creates an instance for an audio processing related exception.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/audio/AudioProcessor.UnhandledAudioFormatException exception` | The cause of the failure. |
| `https://developer.android.com/reference/java/lang/String.html details` | The details associated with this exception. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/ExportException` | The created instance. |

### createForCodec

```
public static ExportException createForCodec(
    Throwable cause,
    @ExportException.ErrorCode int errorCode,
    ExportException.CodecInfo codecInfo
)
```

Creates an instance for a `https://developer.android.com/reference/androidx/media3/transformer/Codec` related exception.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Throwable.html cause` | The cause of the failure. |
| `@https://developer.android.com/reference/androidx/media3/transformer/ExportException.ErrorCode int errorCode` | See `https://developer.android.com/reference/androidx/media3/transformer/ExportException#errorCode()`. |
| `https://developer.android.com/reference/androidx/media3/transformer/ExportException.CodecInfo codecInfo` | The `https://developer.android.com/reference/androidx/media3/transformer/ExportException.CodecInfo`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/ExportException` | The created instance. |

### createForUnexpected

```
public static ExportException createForUnexpected(Throwable cause)
```

Creates an instance for an unexpected exception.

If the exception is a runtime exception, error code `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_FAILED_RUNTIME_CHECK()` is used. Otherwise, the created instance has error code `https://developer.android.com/reference/androidx/media3/transformer/ExportException#ERROR_CODE_UNSPECIFIED()`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Throwable.html cause` | The cause of the failure. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/ExportException` | The created instance. |

### errorInfoEquals

```
public boolean errorInfoEquals(@Nullable ExportException other)
```

Returns whether the error data associated to this exception equals the error data associated to `other`.

Note that this method does not compare the exceptions' stack traces.

### getErrorCodeName

```
public String getErrorCodeName()
```

Equivalent to `https://developer.android.com/reference/androidx/media3/transformer/ExportException#getErrorCodeName(int)`.

### getErrorCodeName

```
public static String getErrorCodeName(@ExportException.ErrorCode int errorCode)
```

Returns the name of a given `errorCode`.