SDK error codes

Updated

List common Voice Calling SDK error codes, their causes, and suggested resolutions.

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 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
  • 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.

Common error codes

Error codeDescription
1General error with no clearly categorized cause. Call the method again.
2An invalid parameter was set in the method. For example, the specified channel name contains illegal characters. Reset the parameters.
3The 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.
4The 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.
5The 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.
6The buffer size is not large enough to hold the returned data.
7The method is called before RtcEngine is initialized. Make sure the RtcEngine object has been created and initialized before calling the method.
8The current state is invalid. Check the SDK callback logs to find the exact reason.
9There is no permission to operate. Check whether the user has granted the app permission to use audio or video devices.
10Method 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.
17Joining 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.
18Failed to leave the channel. The user may already have left the channel, or the leave method may have been called before the user joined.
19The resource is occupied and cannot be reused.
20The SDK abandons the request, possibly due to too many requests.
21Specific firewall settings on Windows cause RtcEngine initialization to fail and then crash.
22The SDK failed to allocate resources, possibly because the app takes up too many resources or the system resources are exhausted.
101Not a valid App ID. Rejoin the channel with a valid App ID.
102Not a valid channel name. The parameter data type may be incorrect. Rejoin the channel with a valid channel name.
103Cannot get server resources for the current region. Try to specify a different region when initializing RtcEngine.
109The 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.
110Token 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.
111The network connection is interrupted. After the SDK established a connection with the server, the network connection was lost for more than 4 seconds.
112Network connection lost. The network connection was interrupted and the SDK could not connect to the server within 10 seconds.
119User failed to switch roles. Try joining the channel again.
120Decryption 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.
121The user ID is invalid.
123This user has been banned by the server. This error is reported when the user is kicked out by the server.
134Invalid user account, possibly because invalid parameters are set.

109 is deprecated. The SDK returns CONNECTION_CHANGED_TOKEN_EXPIRED(9) in onConnectionStateChanged instead.

110 is deprecated. The SDK returns CONNECTION_CHANGED_INVALID_TOKEN(8) in onConnectionStateChanged instead.

Error codeDescription
1005An unspecified error occurred in the audio device. Check if the audio device is occupied by another application or try to re-enter the channel.
1008An error occurred while initializing the playback device. Check if the playback device is occupied by another application or try to re-enter the channel.
1009Error starting the playback device. Check if the playback device is working properly.
1010Error stopping the playback device.
1011Error initializing the recording device. Check if the recording device is working properly, or try to re-enter the channel.
1012Error starting the recording device. Check if the recording device is working properly.
1013Error stopping the recording device.
Error codeDescription
113The user was not in the channel when the sendStreamMessage method was called.
114The length of the data sent was greater than 1024 bytes when sendStreamMessage was called.
115The frequency of sending data exceeded the limit of 6 KB/s when calling sendStreamMessage.
116The number of data streams exceeded the limit of 5 when createDataStream was called.
117Data 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

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