Skip to main content
Version: 3.x.x

Error Events - Android

The onError event tells you about errors that happen in the room.

onError​

  • This event is triggered with a specific error code and message whenever an invalid configuration is provided or a server or network error occurs.
  • This event is helpful for development level troubleshooting while integrating SDK.
  • Override it in a RoomEventListener and register the listener with room.addEventListener().
  • This event can arrive off the main thread. Post to the main thread before you update the UI.

Error payload​

The error passed to onError() is a VideoSDKError with three properties:

PropertyTypeDescription
codeIntNumeric error code, matching a constant returned by VideoSDK.getErrorCodes().
nameStringThe error-code constant name, for example "PUBSUB_SUBSCRIBE_FAILED".
messageStringHuman-readable reason. For server-reported errors this is the server's specific message when it sends one.

To check for a specific error, compare it with a VideoSDKError constant using ==, or match it in a when that has an else branch. Two errors are equal when their codes are equal. Each error is a new object, so don't compare with ===.

Error codes changed in 3.0.0

Several error codes were renumbered in 3.0.0, and some old numbers now mean something else. For example, ERROR_ACTION_PERFORMED_BEFORE_ROOM_JOINED moved from 3001 to 3035, and ERROR_ROOM_RECONNECTING moved from 3014 to 3065. Match errors with VideoSDKError.fromCode(code) instead of raw numbers. See the migration guide for the full list.

Example​

Here is the usage of the event mentioned in this page.

private val roomEventListener: RoomEventListener = object : RoomEventListener() {
//..
override fun onError(error: VideoSDKError) {
Log.d("#error", "Error ${error.code} (${error.name}): ${error.message}")

when (error) {
VideoSDKError.ERROR_ROOM_RECONNECTING -> Log.d("#error", "Reconnecting, try again later")
else -> Unit
}

// onError can arrive off the main thread
runOnUiThread {
Toast.makeText(this@MainActivity, error.message, Toast.LENGTH_SHORT).show()
}
}
}

Errors thrown by actions​

  • Actions such as join(), leave() and unmuteMic() are suspend functions. Call them from a coroutine, for example with lifecycleScope from androidx.lifecycle:lifecycle-runtime-ktx.
  • When an action is refused or fails, it throws a VideoSDKException, which carries a code and a name from the same list of error codes. e.error returns them as a VideoSDKError. Most of these errors are also reported on onError, but some are only thrown, so catch the exception where you call the action. An exception you don't catch crashes the app.
  • Called before the room is joined, or while it is reconnecting, most actions only report 3035 or 3065 on onError and do not throw.
  • For more on calling actions from coroutines and on which errors are thrown, see Coroutines and Error Handling. To read the SDK's logs, see Logs and Diagnostics.
lifecycleScope.launch {
try {
room!!.join()
} catch (e: VideoSDKException) {
Log.d("#error", "Error ${e.code} (${e.name}): ${e.message}")
}
}

Error Codes​

The tables below list each constant with its code and message.

note

In the Android SDK, VideoSDKError and VideoSDK.getErrorCodes() name code 4009 MAX_PARTCIPANT_REACHED and code 4023 UNAUTHORIZED_PARTCIPANT_ID. Compare errors by code, not by name.

1. Errors associated with Organization​

This table lists errors that occur due to the configuration and limitations within your organization’s account. These include account status, participant limits, and add-on service availability.

NameCodeMessage
ACCOUNT_DEACTIVATED4006Your account has been deactivated. Please contact VideoSDK support.
ACCOUNT_DISCONTINUED4007Your account has been discontinued. Please reach out to support for more details.
MAX_PARTICIPANT_REACHED4009You have reached the maximum participant limit for this meeting.
MAX_SPEAKER_REACHED4010The maximum number of speakers for this meeting has been reached.
MAX_SPEAKER_LIMIT_REACHED_ON_ORGANIZATION4026Your organization has reached the maximum number of speakers allowed.
MAX_VIEWER_LIMIT_REACHED_ON_ORGANIZATION4027Your organization has reached the maximum number of viewers allowed.
ADD_ON_SERVICES_DISABLED4021Add-On services have been disabled. Please contact support to enable them.
MAX_RECORDING_LIMIT_REACHED_ON_ORGANIZATION4028You have reached max limit of recording on organization. To increase contact at support@videosdk.live
MAX_HLS_LIMIT_REACHED_ON_ORGANIZATION4029You have reached max limit of hls on organization. To increase contact at support@videosdk.live
MAX_LIVESTREAM_LIMIT_REACHED_ON_ORGANIZATION4030You have reached max limit of livestream on organization. To increase contact at support@videosdk.live
MAX_RECV_ONLY_LIMIT_REACHED_ON_ORGANIZATION4041Your organization has reached the maximum recv-only limit. To increase contact at support@videosdk.live

2. Errors associated with Token​

Errors listed here are related to issues with the API key, authentication tokens, or permissions assigned to users. These errors can occur when tokens are missing, expired, or improperly configured.

NameCodeMessage
INVALID_API_KEY4001The provided API key is either missing or invalid.
INVALID_TOKEN4002The provided token is empty, invalid, or has expired.
INVALID_PERMISSIONS4008The permissions in the token are incorrect. Please verify them.
UNAUTHORIZED_MEETING_ID4022The provided token is not authorized for this meeting ID.
UNAUTHORIZED_PARTICIPANT_ID4023The provided token is not authorized for this participant ID.
UNAUTHORIZED_ROLE4024The role specified in the token is not valid for joining this meeting.
UNAUTHORIZED_REQUEST4025Your request does not match the security configuration.
APIKEY_DEACTIVATED4053The provided API key is deactivated. Please verify it on the dashboard.

3. Errors associated with Meeting and Participant​

This table lists errors resulting from invalid or missing meeting or participant details, including cases where a participant attempts to join with a duplicate ID.

NameCodeMessage
INVALID_MEETING_ID4003The meeting ID provided is either invalid or missing.
INVALID_PARTICIPANT_ID4004The participant ID is either invalid or missing.
DUPLICATE_PARTICIPANT4005This participant has joined from another device.
MEETING_ID_DISABLED4052The provided meeting ID is disabled. Please generate a new meetingId using the API.

4. Errors associated with Add-on Service​

This section addresses errors that occur while using VideoSDK's add-on services such as recording, livestreaming, HLS streaming, and transcription.

NameCodeMessage
START_RECORDING_FAILED4011Failed to start recording. Please try again.
STOP_RECORDING_FAILED4012Failed to stop recording. Please try again.
RECORDING_FAILED5001Recording was stopped due to an error.
START_PARTICIPANT_RECORDING_FAILED4035Failed to start participant recording. Please check the request.
STOP_PARTICIPANT_RECORDING_FAILED4036Failed to stop participant recording.
PARTICIPANT_RECORDING_FAILED5012Participant recording has stopped due to an error.
START_TRACK_RECORDING_FAILED4037Failed to start track recording.
STOP_TRACK_RECORDING_FAILED4038Failed to stop track recording.
TRACK_RECORDING_FAILED5013Track recording stopped due to an unknown error.
PREV_RECORDING_PROCESSING4018Previous recording session is being processed, please try again after few seconds.
RECORDING_DURATION_LIMIT_REACHED5004Recording stopped due to maximum duration being reached.
START_COMPOSITE_RECORDING_FAILED4039Failed to start composite recording. Please try again.
STOP_COMPPOSITE_RECORDING_FAILED4040Failed to stop composite recording. Please try again.
NameCodeMessage
INVALID_LIVESTREAM_CONFIG4015Livestream 'outputs' configuration provided was invalid
START_LIVESTREAM_FAILED4013Failed to start livestream. Please try again.
STOP_LIVESTREAM_FAILED4014Failed to stop livestream. Please try again.
LIVESTREAM_FAILED5002Livestream stopped due to an error.
PREV_RTMP_RECORDING_PROCESSING4019Previous RTMP recording session is being processed, please try again after few seconds!
LIVESTREAM_DURATION_LIMIT_REACHED5005Livestream stopped due to maximum duration being reached.
NameCodeMessage
START_HLS_FAILED4016Failed to start HLS stream.
STOP_HLS_FAILED4017Failed to stop HLS stream.
HLS_FAILED5003HLS streaming stopped due to an error.
PREV_HLS_STREAMING_PROCESSING4020Previous HLS streaming session is still being processed.
HLS_DURATION_LIMIT_REACHED5006HLS stream stopped due to maximum duration being reached.
NameCodeMessage
START_TRANSCRIPTION_FAILED4031Failed to start transcription. Please try again.
STOP_TRANSCRIPTION_FAILED4032Failed to stop transcription.
TRANSCRIPTION_FAILED5007Transcription stopped due to an error.

5. Errors associated with Media​

These errors involve media access, device availability, or permission-related issues affecting camera, microphone, and screen sharing.

NameCodeMessage
ERROR_GET_DISPLAY_MEDIA_PERMISSION_DENIED3016Screen sharing permission denied.
ERROR_CAMERA_ACCESS_DENIED_OR_DISMISSED3017Camera access was denied or dismissed. Grant the camera permission, then try again.
ERROR_MICROPHONE_ACCESS_DENIED_OR_DISMISSED3018Microphone access was denied or dismissed. Grant the microphone permission, then try again.
ERROR_CAMERA_PERMISSION_DENIED_BY_OS3019The camera is blocked on this device, by a device policy or in system settings. Check your device settings, then try again.
ERROR_BLUETOOTH_PERMISSION_DENIED3090Bluetooth permission not granted. To proceed, kindly grant access through your device's settings.
NameCodeMessage
ERROR_BLUETOOTH_AUDIO_ROUTE_FAILED3010Bluetooth audio route failed. SCO connection could not be established after multiple attempts.
ERROR_GET_DISPLAY_MEDIA3013This device does not support screen sharing.
ERROR_CAMERA_NOT_FOUND3021Please ensure your camera is connected and turned on, and that the camera driver is installed and up-to-date.
ERROR_MICROPHONE_NOT_FOUND3022Please ensure your microphone is connected and turned on.
ERROR_CAMERA_IN_USE3023The camera is being used by another application. Close it, then try again.
ERROR_MICROPHONE_IN_USE3024The microphone is being used by another application. Close it, then try again.
ERROR_VIDEO_SOURCE_INITIATION_FAILED3026Unable to start the video source. Check the camera permission, then try again.
ERROR_CAMERA_ACCESS_UNAVAILABLE3033Camera access unavailable: the camera list could not be read, or this room cannot carry video.
ERROR_MICROPHONE_ACCESS_UNAVAILABLE3034Microphone access unavailable: the microphone list could not be read, or this room cannot carry audio.
ERROR_NO_WEBCAM_DEVICE_FOUND3051No camera found: check the camera id passed, and that this device has a camera.
ERROR_NO_MICROPHONE_DEVICE_FOUND3059No microphone found: check the audio device passed, and that it is still connected.

6. Errors associated with Track & Codec​

These errors are triggered when there are issues with video, audio, or screen-share tracks, or when the requested codec is not supported.

NameCodeMessage
ERROR_WEBCAM_TRACK_ENDED3027Webcam track has ended or the webcam is disconnected. Please ensure your webcam is properly connected and try restarting it.
ERROR_CUSTOM_VIDEO_TRACK_ENDED3031The provided custom video track is in an ended state. Please verify the video track's status, and try again.
ERROR_CUSTOM_AUDIO_TRACK_ENDED3032The provided custom audio track is in an ended state. Please verify the audio track's status, and try again.
ERROR_WEBCAM_PRODUCE_FAILED3049The camera track was created but could not be published to the room.
ERROR_VIDEO_TRACK_CREATION_FAILED3053Failed to create the video track.
ERROR_MICROPHONE_PRODUCE_FAILED3058The microphone track was created but could not be published to the room.
ERROR_AUDIO_TRACK_CREATION_FAILED3060Failed to create the audio track.
ERROR_SCREENSHARE_PRODUCE_FAILED3061Failed to start screen sharing.
ERROR_WEBCAM_NOT_ENABLED3062The webcam is not enabled. Enable it before setting quality.
ERROR_SET_WEBCAM_QUALITY_FAILED3063Failed to set the webcam quality.
ERROR_CAPTURE_IMAGE_FAILED3069Unable to capture the image. Please try again.
ERROR_INVALID_CUSTOM_TRACK_CONFIG3071Invalid custom track configuration.
ERROR_WEBCAM_CLOSE_PRODUCER_FAILED3076The camera could not be turned off. Please try again.
ERROR_MICROPHONE_CLOSE_PRODUCER_FAILED3077The microphone could not be turned off. Please try again.
ERROR_VIDEO_EFFECTS_GRAPH_UNAVAILABLE3080GPU video effects could not start on this device; video is sent without effects.

For how VideoSDK handles these errors, refer to the Video Codecs guide.

NameCodeMessage
ERROR_VIDEO_PRODUCE_CODEC_NOT_SUPPORTED3045The provided codec is not supported for producing video on this device. Falling back to VP8.
ERROR_MULTISTREAM_NOT_SUPPORTED3046Multistream is not supported for this codec.
ERROR_NO_SUPPORTED_VIDEO_CODEC3052No supported video codec is available on this device.
CREATE_CONSUMER_FAILED4050Failed to create consumer.
CODEC_NOT_SUPPORTED4051Your platform doesn't support the remote participant's video codec.

7. Errors associated with Actions​

These errors are triggered when an action cannot run in the current state — called before the room is joined, while it is reconnecting, while the same action is still running, with an invalid argument, or when the SDK cannot reach the VideoSDK servers in time. The delivered message names the rejected method when available; the messages below are the fallback text.

NameCodeMessage
ERROR_ACTION_PERFORMED_BEFORE_ROOM_JOINED3035Oops! Something went wrong. The room was in a connecting state, and during that time, an action encountered an issue. Please try again after joining a room.
ERROR_ACTION_NOT_SUPPORTED_IN_MODE3066This action is not supported in the current room mode.
ERROR_ACTION_NOT_SUPPORTED3068This action is not supported here.
ERROR_INVALID_PARAMETER3073The provided parameter is missing or invalid. Please verify the provided parameter and try again.
NameCodeMessage
ERROR_UNABLE_TO_JOIN_ROOM3047Unable to join the room. Please try again.
ERROR_MEDIA_NOT_READY3048The room's media connection is not ready yet. Please try again in a moment.
ERROR_MEDIA_DEVICE_NOT_INITIALIZED3050The media device has not been initialized.
ERROR_MEDIA_DEVICE_NOT_LOADED3064The media device is not loaded yet. Please try again in a moment.
ERROR_OPERATION_TIMED_OUT3079The operation timed out. Please check your connection and try again.
NameCodeMessage
ERROR_ALREADY_IN_REQUESTED_STATE3054The requested state is already active.
ERROR_OPERATION_IN_PROGRESS3055The requested operation is already in progress.
ERROR_OPERATION_ABORTED3056The operation was aborted before it completed.
ERROR_ROOM_RECONNECTING3065The room is reconnecting. Please try again once it reconnects.

8. Errors associated with Participant and Meeting​

These errors are triggered when the server rejects a request that targets a remote participant or changes the room — including stream subscriptions, room mode, room switching, and media relay. The state stays as it was.

NameCodeMessage
REMOVE_PARTICIPANT_FAILED4066Failed to remove the participant. Please try again.
ENABLE_PARTICIPANT_MIC_FAILED4067Failed to enable the participant's microphone. Please try again.
DISABLE_PARTICIPANT_MIC_FAILED4068Failed to disable the participant's microphone. Please try again.
ENABLE_PARTICIPANT_WEBCAM_FAILED4069Failed to enable the participant's webcam. Please try again.
DISABLE_PARTICIPANT_WEBCAM_FAILED4070Failed to disable the participant's webcam. Please try again.
PIN_FAILED4071Failed to pin the participant. Please try again.
UNPIN_FAILED4072Failed to unpin the participant. Please try again.
SET_QUALITY_FAILED4073Failed to set the stream quality. Please try again.
NameCodeMessage
ERROR_END_ROOM_FAILED3057Unable to end the room. Please try again.
ADAPTIVE_SUBSCRIPTION_NOT_ENABLED_BY_SDK4047Adaptive subscription is not enabled by the SDK. Please contact at support@videosdk.live
ADAPTIVE_SUBSCRIPTION_ENABLE_FAILED4048Adaptive subscription is already enabled.
ADAPTIVE_SUBSCRIPTION_DISABLE_FAILED4049Adaptive subscription is already disabled.
PAUSE_ALL_STREAMS_FAILED4057Failed to pause all streams. Please try again.
RESUME_ALL_STREAMS_FAILED4058Failed to resume all streams. Please try again.
RESPOND_ENTRY_FAILED4059Failed to respond to the entry request. Please try again.
CHANGE_MODE_FAILED4065Failed to change the room mode. Please try again.
PAUSE_STREAM_FAILED4074Failed to pause the stream. Please try again.
RESUME_STREAM_FAILED4075Failed to resume the stream. Please try again.
SWITCH_ROOM_FAILED4076Failed to switch the room. Please try again.
SWITCH_PARTICIPANT_ROOM_FAILED4077Failed to switch the participant's room. Please try again.
REQUEST_MEDIA_RELAY_FAILED4078Failed to request media relay. Please try again.
STOP_MEDIA_RELAY_FAILED4079Failed to stop media relay. Please try again.
CONSUME_MIC_STREAMS_FAILED4080Failed to consume the participant's microphone streams. Please try again.
CONSUME_WEBCAM_STREAMS_FAILED4081Failed to consume the participant's webcam streams. Please try again.
STOP_CONSUMING_MIC_STREAMS_FAILED4082Failed to stop consuming the participant's microphone streams. Please try again.
STOP_CONSUMING_WEBCAM_STREAMS_FAILED4083Failed to stop consuming the participant's webcam streams. Please try again.
RESPOND_MEDIA_RELAY_REQUEST_FAILED4084Failed to respond to the media relay request. Please try again.

9. Errors associated with Collaboration​

These errors are triggered while using in-room collaboration features such as PubSub messaging, data messages, file sharing, the realtime key-value store, the whiteboard, and translation.

PubSub​

NameCodeMessage
PUBSUB_PUBLISH_FAILED4087Failed to publish the message to the pubsub topic. Please try again.
PUBSUB_SUBSCRIBE_FAILED4088Failed to subscribe to the pubsub topic. Please try again.
PUBSUB_UNSUBSCRIBE_FAILED4089Failed to unsubscribe from the pubsub topic. Please try again.

Data messages​

NameCodeMessage
ERROR_SEND_FAILED3070Unable to send the message. Please try again.
ERROR_PAYLOAD_TOO_LARGE3072Payload exceeds the maximum allowed size.

File sharing​

NameCodeMessage
ERROR_FILE_UPLOAD_FAILED3074Unable to upload the file. Please try again.
ERROR_FILE_FETCH_FAILED3075Unable to fetch the file. Please try again.

Realtime Store​

NameCodeMessage
FAILED_TO_SET_VALUE4045Failed to set realtime store value.
FAILED_TO_GET_VALUE4046Failed to get realtime store value.
FAILED_TO_OBSERVE_VALUE4085Failed to start observing the realtime store value.
FAILED_TO_STOP_OBSERVING_VALUE4086Failed to stop observing the realtime store value.

Whiteboard​

NameCodeMessage
START_WHITEBOARD_FAILED4054Failed to start the whiteboard. Please try again.
STOP_WHITEBOARD_FAILED4055Failed to stop the whiteboard. Please try again.
WHITEBOARD_OPERATION_IN_PROGRESS4056A whiteboard operation is already in progress. Please wait for it to complete.

Translation​

NameCodeMessage
START_TRANSLATION_FAILED4042Translation start request failed due to an unknown error.
STOP_TRANSLATION_FAILED4043Translation stop request failed due to an unknown error.
CHANGE_TRANSLATION_LANGUAGE_FAILED4044Change translation language request failed due to an unknown error.
TRANSLATION_FAILED5015Translation failed due to an unknown error.

10. Other errors​

These errors are reported when the cause of a failure is not known.

NameCodeMessage
UNKNOWN_ERROR4000An unknown error occurred.
SOMETHING_WENT_WRONG5000Something went wrong.
note
  • An error reaches your app as a VideoSDKException thrown by the call that failed, on onError, or both. 3048, 3066, 3072 and 3073 are only thrown: they never reach onError. The exception is VideoSDK.createScreenShareVideoTrack(), which returns null and reports 3048 on onError.
  • A repeated disableAdaptiveSubscription() currently reports 4048, not 4049.
  • 3080 is only reported on onError, once each time the GPU effects can't start, and its message ends with Reason: and the runtime error. Nothing is thrown, and the call keeps going without effects. A GRAPH request made before any camera has started is not an error.
  • The message you receive can be more specific than the text in these tables: for example, the server's own message, or one that names the call that failed. Check the code, not the message.
  • VideoSDKError also lists codes that the Android SDK never reports as a VideoSDKException or on onError: 3002 to 3007, 3011, 3012, 3014, 3015, 3020, 3025, 3028 to 3030, 3036 to 3044, 3067 and 3078. A pre-call test can still report ERROR_MICROPHONE_TRACK_ENDED, ERROR_INVALID_CUSTOM_VIDEO_TRACK or ERROR_INVALID_CUSTOM_AUDIO_TRACK as the code of a PreCallTestException.

API Reference​

The API references for all the methods and events utilised in this guide are provided below.

Got a Question? Ask us on discord