# SDK error codes (/en/realtime-media/voice/reference/error-codes)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

<_PlatformTabsGroup groupMode="structured" canonicalPlatform="web" platforms="[&#x22;android&#x22;,&#x22;ios&#x22;,&#x22;macos&#x22;,&#x22;windows&#x22;,&#x22;electron&#x22;,&#x22;flutter&#x22;,&#x22;react-native&#x22;,&#x22;javascript&#x22;,&#x22;unity&#x22;,&#x22;unreal&#x22;,&#x22;blueprint&#x22;,&#x22;python&#x22;,&#x22;web&#x22;]" showTabs="true">
  <_PlatformPanel platform="android">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="android" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="ios">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="ios" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes-1]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes-1]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes-1]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes-1]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="macos">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="macos" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes-2]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes-2]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes-2]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes-2]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="windows">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="windows" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes-3]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes-3]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes-3]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes-3]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="electron">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="electron" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes-4]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes-4]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes-4]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes-4]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="flutter">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="flutter" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes-5]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes-5]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes-5]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes-5]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="react-native">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="react-native" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes-6]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes-6]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes-6]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes-6]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="javascript">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="javascript" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes-7]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes-7]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes-7]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes-7]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="unity">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="unity" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes-8]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes-8]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes-8]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes-8]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="unreal">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="unreal" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes-9]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes-9]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes-9]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes-9]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="blueprint">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="blueprint" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes-10]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes-10]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes-10]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes-10]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="python">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="python" />

    When interacting with the Agora API, the Voice SDK may return an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    This page provides descriptions for common error codes, their causes, and suggested solutions. For error codes without predefined solutions, [contact technical support](https://agora-ticket.agora.io/) for assistance.

    The error codes listed in this section apply to Agora RTC v4.x SDK on the following platforms:

    * Native platforms: Android, iOS, macOS, Windows
    * Third-party frameworks based on native platforms: Electron, Unity, React Native, Flutter

    During SDK operation, error codes may be returned in the following ways:

    * In the return value of a failed method call
    * Through the `onError` callback

    <CalloutContainer type="info">
      <CalloutDescription>
        - When the SDK returns an error code, it may return a negative number. This negative number corresponds to the positive integer in the error code. For example, if it returns `-2`, it corresponds to `2` in the error code.
        - The API names in this article are based on the C++ API. The API names for other platforms may be different. Refer to the API documentation for the corresponding platform.
      </CalloutDescription>
    </CalloutContainer>

    ## Common error codes [#common-error-codes-11]

    | Error code | Description                                                                                                                                                                                                                                                                   |
    | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |     `1`    | General error with no clearly categorized cause. Call the method again.                                                                                                                                                                                                       |
    |     `2`    | An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.                                                                                                                                        |
    |     `3`    | The SDK is not ready yet. Common reasons include failed `RtcEngine` initialization, calling a method before joining a channel, calling `rate` or `complain` before leaving a channel, the audio module not being enabled, or incomplete assembly.                             |
    |     `4`    | The current state of `RtcEngine` does not support this operation. Common reasons include setting an incorrect built-in encryption mode or failing to load the external encryption library.                                                                                    |
    |     `5`    | The method call is rejected. Common reasons include failed `RtcEngine` initialization, an empty channel name when joining a channel, or reusing an existing channel name in a multi-channel use case.                                                                         |
    |     `6`    | The buffer size is not large enough to hold the returned data.                                                                                                                                                                                                                |
    |     `7`    | The method is called before `RtcEngine` is initialized. Make sure the `RtcEngine` object has been created and initialized before calling the method.                                                                                                                          |
    |     `8`    | The current state is invalid. Check the SDK callback logs to find the exact reason.                                                                                                                                                                                           |
    |     `9`    | There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.                                                                                                                                                       |
    |    `10`    | Method call timed out. Some method calls require the SDK to return results, and this error occurs if the SDK takes too long to process the event and does not return for more than 10 seconds.                                                                                |
    |    `17`    | Joining a channel is rejected. The user may already be in the channel, or an echo test may still be running. Agora recommends using `onConnectionStateChanged` to determine whether the user is in the channel, and calling `stopEchoTest` before joining after an echo test. |
    |    `18`    | Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.                                                                                                                                     |
    |    `19`    | The resource is occupied and cannot be reused.                                                                                                                                                                                                                                |
    |    `20`    | The SDK abandons the request, possibly due to too many requests.                                                                                                                                                                                                              |
    |    `21`    | Specific firewall settings on Windows cause `RtcEngine` initialization to fail and then crash.                                                                                                                                                                                |
    |    `22`    | The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.                                                                                                                                             |
    |    `101`   | Not a valid App ID. Rejoin the channel with a valid App ID.                                                                                                                                                                                                                   |
    |    `102`   | Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.                                                                                                                                                             |
    |    `103`   | Cannot get server resources for the current region. Try to specify a different region when initializing `RtcEngine`.                                                                                                                                                          |
    |    `109`   | The currently used token has expired and is no longer valid. Generate a new token on the server side and call `renewToken` to update the token.                                                                                                                               |
    |    `110`   | Token is invalid. Common reasons include enabling the App Certificate without using token authentication, or using a token whose `uid` does not match the `uid` used to join the channel.                                                                                     |
    |    `111`   | The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.                                                                                                                       |
    |    `112`   | Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.                                                                                                                                                |
    |    `119`   | User failed to switch roles. Try joining the channel again.                                                                                                                                                                                                                   |
    |    `120`   | Decryption failed. The user may have used the wrong password when joining the channel. Check the password the user entered when joining the channel, or ask the user to rejoin.                                                                                               |
    |    `121`   | The user ID is invalid.                                                                                                                                                                                                                                                       |
    |    `123`   | This user has been banned by the server. This error is reported when the user is kicked out by the server.                                                                                                                                                                    |
    |    `134`   | Invalid user account, possibly because invalid parameters are set.                                                                                                                                                                                                            |

    <CalloutContainer type="info">
      <CalloutDescription>
        `109` is deprecated. The SDK returns `CONNECTION_CHANGED_TOKEN_EXPIRED(9)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        `110` is deprecated. The SDK returns `CONNECTION_CHANGED_INVALID_TOKEN(8)` in `onConnectionStateChanged` instead.
      </CalloutDescription>
    </CalloutContainer>

    ## Audio-related error codes [#audio-related-error-codes-11]

    | Error code | Description                                                                                                                                               |
    | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
    |   `1005`   | An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.           |
    |   `1008`   | An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel. |
    |   `1009`   | Error starting the playback device. Check if the playback device is working properly.                                                                     |
    |   `1010`   | Error stopping the playback device.                                                                                                                       |
    |   `1011`   | Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.                               |
    |   `1012`   | Error starting the recording device. Check if the recording device is working properly.                                                                   |
    |   `1013`   | Error stopping the recording device.                                                                                                                      |

    ## Data stream-related error codes [#data-stream-related-error-codes-11]

    | Error code | Description                                                                                                                                                                    |
    | :--------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    |    `113`   | The user was not in the channel when the `sendStreamMessage` method was called.                                                                                                |
    |    `114`   | The length of the data sent was greater than 1024 bytes when `sendStreamMessage` was called.                                                                                   |
    |    `115`   | The frequency of sending data exceeded the limit of 6 KB/s when calling `sendStreamMessage`.                                                                                   |
    |    `116`   | The number of data streams exceeded the limit of 5 when `createDataStream` was called.                                                                                         |
    |    `117`   | Data stream send timeout. If reliable or ordered data is not received within 5 seconds, or missing data is detected, `onStreamMessageError` is triggered on the receiving end. |

    ## Other error codes [#other-error-codes-11]

    | Error code | Description                                                                              |
    | :--------: | ---------------------------------------------------------------------------------------- |
    |    `130`   | The SDK does not support pushing encrypted streams to a CDN.                             |
    |   `1001`   | Failed to load the media engine.                                                         |
    |   `1501`   | There is no permission to use the camera. Check if camera permission has been turned on. |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="web">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="web" />

    When interacting with the Agora API, the Voice SDK for Web may throw an error code. Receiving an error code indicates that the SDK has encountered an unrecoverable error that requires intervention from your app.

    For asynchronous methods, the SDK returns a Promise to notify the result of the asynchronous operation, and the SDK throws the appropriate error code when the Promise is rejected. When a synchronous method call fails, the SDK throws an error code directly. The SDK may also throw some network-related error codes during internal operation.

    The SDK error object `AgoraRTCError` inherits from the browser [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. Print the error code through `AgoraRTCError.code`, because directly printing the `AgoraRTCError` object only shows the error message.

    ## Common error codes [#common-error-codes-12]

    | Error code              | Description                                                                                                                                                       | Resolution                                                                                                                          |
    | :---------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------- |
    | `UNEXPECTED_ERROR`      | An unhandled, unexpected error. Usually, this error includes a specific error message.                                                                            | Refer to the specific error message.                                                                                                |
    | `UNEXPECTED_RESPONSE`   | The server returned an unexpected response. This error is usually thrown when a network problem causes the client state to be inconsistent with the server state. | Wait for the network to stabilize and retry the operation.                                                                          |
    | `INVALID_PARAMS`        | Illegal parameters.                                                                                                                                               | Follow the specific prompts to confirm the operation and pass the correct parameters according to the documentation.                |
    | `NOT_SUPPORTED`         | The browser does not support the feature.                                                                                                                         |                                                                                                                                     |
    | `INVALID_OPERATION`     | Illegal operation. This usually occurs because the operation cannot be performed in the current state.                                                            | Confirm the order of operations. For example, confirm that you have joined the channel before publishing.                           |
    | `OPERATION_ABORTED`     | The operation is aborted, usually due to poor network quality or disconnection that causes communication failure with the Agora server.                           | Confirm the local network status through `AgoraRTCClient.on("user-joined")` and retry the operation.                                |
    | `WEB_SECURITY_RESTRICT` | Browser security policy restriction.                                                                                                                              | Make sure the web page is running in a [secure environment](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts). |
    | `NO_ACTIVE_STATUS`      | The Agora project is inactive or disabled.                                                                                                                        | Go to Agora Console to confirm that the project status is enabled.                                                                  |

    ## Request-related error codes [#request-related-error-codes]

    ### Network connection [#network-connection]

    | Error code               | Description                                                                                                                          | Resolution                                                                                                               |
    | :----------------------- | :----------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------- |
    | `NETWORK_TIMEOUT`        | The request times out, usually because communication with the Agora server fails due to poor network quality or a broken connection. | Confirm the local network conditions through `AgoraRTCClient.on("user-joined")` and retry the operation.                 |
    | `NETWORK_RESPONSE_ERROR` | Response error, typically an illegal status code.                                                                                    | Verify that the parameters for the operation are correct and pass the correct parameters according to the documentation. |
    | `NETWORK_ERROR`          | Unlocatable network error.                                                                                                           | None.                                                                                                                    |

    ### SDK internal requests [#sdk-internal-requests]

    | Error code      | Description                                                   | Resolution                                                                                                            |
    | :-------------- | :------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------- |
    | `WS_ABORT`      | WebSocket disconnected during a request to the Agora server.  | Listen to `AgoraRTCClient.on("connection-state-change")` and retry after the connection state changes to `CONNECTED`. |
    | `WS_DISCONNECT` | WebSocket is disconnected before requesting the Agora server. | Listen to `AgoraRTCClient.on("connection-state-change")` and retry after the connection state changes to `CONNECTED`. |
    | `WS_ERR`        | An error occurred in the WebSocket connection.                | Check the current browser support for WebSocket.                                                                      |

    ### Device management related error codes [#device-management-related-error-codes]

    | Error code                 | Description                                                            | Resolution                     |
    | :------------------------- | :--------------------------------------------------------------------- | :----------------------------- |
    | `ENUMERATE_DEVICES_FAILED` | Failed to enumerate local devices, usually due to browser limitations. | None.                          |
    | `DEVICE_NOT_FOUND`         | The specified device could not be found.                               | Pass in the correct device ID. |

    ### Track-related error codes [#track-related-error-codes]

    | Error code                    | Description                                                                                                                    | Resolution                                                                          |
    | :---------------------------- | :----------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------- |
    | `TRACK_IS_DISABLED`           | The track is disabled, usually because `Track.setEnabled()` is set to `false`.                                                 | Call `Track.setEnabled(true)` on the track before proceeding.                       |
    | `SHARE_AUDIO_NOT_ALLOWED`     | The end user did not click **Share Audio** when the audio pop-up was presented on the screen.                                  | Prompt the end user to check **Share Audio** in the screen sharing pop-up window.   |
    | `MEDIA_OPTION_INVALID`        | Unsupported parameters for media capture.                                                                                      | Modify the media capture parameters or use the SDK's preset configuration.          |
    | `CONSTRAINT_NOT_SATISFIED`    | Unsupported parameters for media capture.                                                                                      | Modify the media capture parameters or use the SDK's preset configuration.          |
    | `PERMISSION_DENIED`           | Permission to obtain a media device was denied.                                                                                | Select **Allow** in the device permissions pop-up window.                           |
    | `NOT_READABLE`                | The user is authorized, but the media device is not accessible.                                                                | Check the current capture device and driver for errors.                             |
    | `FETCH_AUDIO_FILE_FAILED`     | Failed to download an online audio file.                                                                                       | Fill in the correct online audio address and make sure it can be accessed properly. |
    | `READ_LOCAL_AUDIO_FILE_ERROR` | Failed to read the local audio file.                                                                                           | Fill in the correct local audio file path.                                          |
    | `DECODE_AUDIO_FILE_FAILED`    | Audio file decoding failed, probably because the audio file uses an encoding format that is not supported by browser WebAudio. | Check whether browser WebAudio supports the encoding format of the audio file.      |

    ## Client-related error codes [#client-related-error-codes]

    ### Join the channel [#join-the-channel]

    The following table lists the error codes thrown by the SDK when joining a channel fails:

    | Error code                         | Description                                                        | Resolution                                |
    | :--------------------------------- | :----------------------------------------------------------------- | :---------------------------------------- |
    | `UID_CONFLICT`                     | Duplicate UIDs in the same channel.                                | Use a different UID to enter the channel. |
    | `INVALID_UINT_UID_FROM_STRING_UID` | The String UID allocation service returned an illegal integer UID. | Use a different UID to enter the channel. |
    | `CAN_NOT_GET_PROXY_SERVER`         | Unable to get the cloud proxy service address.                     | None.                                     |
    | `CAN_NOT_GET_GATEWAY_SERVER`       | Unable to get the Agora server address.                            | None.                                     |

    ### Publish/Unpublish [#publishunpublish]

    The following table lists the error codes thrown by the SDK when publishing or unpublishing a track fails:

    | Error code                              | Description                               | Resolution                                                                                                                  |
    | :-------------------------------------- | :---------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------- |
    | `INVALID_LOCAL_TRACK`                   | An illegal `LocalTrack` was passed in.    | Check the incoming track and pass in the correct `LocalTrack`.                                                              |
    | `CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS` | A client publishes multiple video tracks. | A client can publish only one video track at a time. If you want to publish multiple video tracks, create multiple clients. |

    ### Subscribe/Unsubscribe [#subscribeunsubscribe]

    The following table lists the error codes thrown by the SDK when subscribing or unsubscribing fails:

    | Error code                     | Description                                                                                                               | Resolution                                                                                                                                                                                                                                                                                           |
    | :----------------------------- | :------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | `INVALID_REMOTE_USER`          | Illegal remote user. The remote user is not in the channel or has not published any media tracks yet.                     | Subscribe only after receiving the `AgoraRTCClient.on("user-published")` event.                                                                                                                                                                                                                      |
    | `REMOTE_USER_IS_NOT_PUBLISHED` | The remote user has published an audio or video track that does not match the type specified in your subscribe operation. | Ensure that the track type passed in by the subscribe operation matches the type returned by `AgoraRTCClient.on("user-published")`, or confirm before subscribing that the remote user has published the expected track type through `AgoraRTCRemoteUser.hasVideo` or `AgoraRTCRemoteUser.hasAudio`. |
    | `ERR_TOO_MANY_BROADCASTERS`    | The number of hosts in the channel exceeds the limit.                                                                     | Control the number of hosts. For example, call `Client.setClientRole` only when the user needs to publish an audio or video track to switch the user role to host.                                                                                                                                   |
    | `ERR_TOO_MANY_SUBSCRIBERS`     | The number of hosts subscribed to by the current user exceeds the limit.                                                  | Subscribe to hosts on demand.                                                                                                                                                                                                                                                                        |

    ### Pushing stream to CDN [#pushing-stream-to-cdn]

    The following table lists the error codes thrown by the SDK when pushing a stream to a CDN fails:

    | Error code                                     | Description                                                                | Resolution                                                                                           |
    | :--------------------------------------------- | :------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------- |
    | `LIVE_STREAMING_TASK_CONFLICT`                 | The push stream task already exists.                                       | Call `Client.stopLiveStreaming` to stop this push streaming task before starting it again.           |
    | `LIVE_STREAMING_INVALID_ARGUMENT`              | Push stream parameter error.                                               | Refer to the API documentation for `Client.startLiveStreaming` and check the push stream parameters. |
    | `LIVE_STREAMING_INTERNAL_SERVER_ERROR`         | Internal error occurred on the push stream server.                         | Retry the push stream operation. If it still fails, refresh the page and try again.                  |
    | `LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED` | The push stream URL is occupied.                                           | Check whether the specified URL is occupied.                                                         |
    | `LIVE_STREAMING_CDN_ERROR`                     | An error occurred in the target CDN, causing the push stream task to fail. | Confirm the health of the target CDN.                                                                |
    | `LIVE_STREAMING_INVALID_RAW_STREAM`            | Push stream timeout.                                                       | Confirm that the target stream exists.                                                               |

    ### Cross-channel connection [#cross-channel-connection]

    The following table lists the error codes thrown by the SDK when cross-channel media relay fails:

    | Error code                                 | Description                                                                                        |
    | :----------------------------------------- | :------------------------------------------------------------------------------------------------- |
    | `CROSS_CHANNEL_WAIT_STATUS_ERROR`          | An error occurred while waiting for the `AgoraRTCClient.on("channel-media-relay-state")` callback. |
    | `CROSS_CHANNEL_FAILED_JOIN_SRC`            | Failed to initiate a cross-channel media stream forwarding request.                                |
    | `CROSS_CHANNEL_FAILED_JOIN_DEST`           | Failed to accept a cross-channel media stream forwarding request.                                  |
    | `CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST` | The server failed to receive a cross-channel forwarded media stream.                               |
    | `CROSS_CHANNEL_SERVER_ERROR_RESPONSE`      | The server responded with an error.                                                                |

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>
</_PlatformTabsGroup>
