Skip to main content
Find solutions to common issues when building with the CometChat Android SDK.
IssueFix
init() failsVerify App ID and Region from Dashboard
Login fails with “UID not found”Create user via Dashboard or REST API first
SDK methods failEnsure init() completes before calling other methods
No real-time eventsCheck WebSocket connection, verify listeners registered
Build failsCheck Gradle dependency version and repository URL

Initialization & Authentication

SymptomCauseFix
init() fails with “App ID not found”Invalid App ID or RegionVerify credentials in Dashboard → API & Auth Keys
init() fails silentlyMissing credentialsDouble-check App ID and Region are non-null strings
”CometChat not initialized”init() not awaitedEnsure init() callback’s onSuccess fires before calling other methods
Login fails with “UID not found”User doesn’t existCreate user via Dashboard or REST API
Login fails with “Auth Key is not valid”Wrong Auth KeyVerify Auth Key in Dashboard. Don’t confuse with REST API Key
getLoggedInUser() returns nullSession cleared or init() not calledCall init() on every app start before checking session
Auth Token expiredToken lifetime exceededGenerate new token via REST API
User appears offline after loginPresence not configuredUse subscribePresenceForAllUsers() in AppSettingsBuilder

Gradle & Build Issues

SymptomCauseFix
Could not resolve com.cometchat:chat-sdk-androidMissing repositoryAdd https://dl.cloudsmith.io/public/cometchat/cometchat/maven/ to your project-level build.gradle repositories block
Duplicate class errors at compile timeMultiple versions of a dependencyRun ./gradlew dependencies to find conflicts. Use exclude group: or force a single version
Manifest merger failedConflicting minSdkVersionSet minSdkVersion to at least 21 (24 if using the Calls SDK) in your app-level build.gradle
Java 8 features not supportedMissing compile optionsAdd compileOptions { sourceCompatibility JavaVersion.VERSION_1_8; targetCompatibility JavaVersion.VERSION_1_8 } to your android block
Build succeeds but crashes on launchAndroidX not enabledAdd android.useAndroidX=true and android.enableJetifier=true to gradle.properties
Calls SDK not foundNot added to GradleAdd implementation 'com.cometchat:calls-sdk-android:4.x.x' to your app-level build.gradle

Permissions

SymptomCauseFix
App crashes when sending mediaMissing storage permissionRequest READ_EXTERNAL_STORAGE / READ_MEDIA_IMAGES at runtime before file access
No audio in callsRECORD_AUDIO not grantedRequest RECORD_AUDIO permission before initiating or joining a call
No video in callsCAMERA not grantedRequest CAMERA permission before initiating or joining a video call
Permission dialog never appearsPermission not declared in manifestAdd the required <uses-permission> tags to AndroidManifest.xml
Permission permanently deniedUser selected “Don’t ask again”Use shouldShowRequestPermissionRationale() to detect this and direct the user to app settings

ProGuard & Release Builds

SymptomCauseFix
App works in debug but crashes in releaseProGuard stripping SDK classesAdd CometChat ProGuard rules (see below) to your proguard-rules.pro
ClassNotFoundException in release buildObfuscation removing required classEnsure -keep class com.cometchat.** rules are applied
JSON parsing errors in releaseModel class fields renamed by ProGuardAdd -keepclassmembers rules for SDK model classes
Calls SDK crashes in releaseCalls SDK classes obfuscatedAdd -keep class com.cometchat.calls.** to your ProGuard rules
Add these rules to your proguard-rules.pro:
-keep class com.cometchat.** { *; }
-keep class com.cometchat.calls.** { *; }
-dontwarn com.cometchat.**

Messaging

SymptomCauseFix
sendMessage() failsNot logged in or invalid receiverEnsure login() completes. Verify receiver UID/GUID exists
Messages sent but not receivedListener not registeredRegister addMessageListener() with onTextMessageReceived
Duplicate messagesMultiple listeners with same IDUse unique listener IDs. Remove old listeners before re-registering
Wrong conversationWrong receiver typeUse CometChatConstants.RECEIVER_TYPE_USER for 1:1, RECEIVER_TYPE_GROUP for groups
Media upload failsFile too large or unsupportedCheck limits. Supported: PNG, JPG, GIF, MP4, MP3, WAV
Metadata not appearingSet after sendCall setMetadata() before the send method
Pagination not workingNew request objectReuse the same MessagesRequest for fetchPrevious()/fetchNext()
Thread replies in main chatMissing filterAdd .hideReplies(true) to MessagesRequestBuilder
Deleted messages showingMissing filterAdd .hideDeletedMessages(true)

Groups

SymptomCauseFix
Cannot join groupInvalid GUIDVerify GUID. Create group first if needed
Cannot send to groupNot a memberJoin group first with joinGroup()
Cannot kick/ban membersInsufficient scopeOnly admins and moderators can kick/ban
Can’t join private groupRequires invitePrivate groups require an admin to add you
Owner can’t leaveOwnership not transferredCall transferGroupOwnership() first
Password join failsWrong passwordPass correct password as the third parameter
fetchNext() returns same resultsNew request objectReuse the same GroupsRequest instance
Scope filter returns nothingInvalid stringsUse "admin", "moderator", "participant"
Cannot demote adminNot ownerOnly the group owner can demote admins
Kicked user can still see groupKick vs banUse banGroupMember() to prevent rejoining

Calling

SymptomCauseFix
Calls SDK not foundNot added to GradleAdd implementation 'com.cometchat:calls-sdk-android:4.x.x'
No audio/videoPermissions deniedRequest CAMERA and RECORD_AUDIO permissions at runtime before the call
Call not connectingSession ID mismatchVerify both participants use the same session ID
One-way audioFirewall blocking WebRTCCheck network config. Corporate networks may block WebRTC ports
Incoming call not showingListener not registeredRegister addCallListener() at the Application or root Activity level
Call ended event not receivedWrong callbackUse onCallEndedMessageReceived in CallListener for call-end messages, onCallEnded in OngoingCallListener for session events
Black screen after joiningView not visible or sizedEnsure the call container View has non-zero dimensions and is visible
Calls crash in release buildProGuard stripping classesAdd -keep class com.cometchat.calls.** { *; } to proguard-rules.pro

WebSocket & Connection

SymptomCauseFix
Real-time events not receivedWebSocket disconnectedCheck getConnectionStatus(). Reconnect if needed
WebSocket failsFirewall blockingCheck network config. Corporate firewalls may block WebSocket connections
Connection drops frequentlyNetwork instabilityUse addConnectionListener() to monitor and reconnect
Stuck in “connecting”Network or config issueVerify network, appId, and region
featureThrottled statusFeature rate-limitedReduce frequency of the throttled feature. Listen for onFeatureThrottled in ConnectionListener
No events after loginAuto-connect disabledCall CometChat.connect() manually if autoEstablishSocketConnection(false)
connect() doesn’t workNot logged inEnsure user is logged in first

Listeners & Lifecycle

SymptomCauseFix
Events not firingRegistered before initRegister after init() and login() complete
Duplicate eventsMultiple listeners with same IDRemove old listeners before adding new ones
Missing events after navigationListeners removed on onPause()Re-register in onResume() when the screen becomes active
Events fire after screen is closedListeners not removedRemove listeners in onPause() or onDestroy()
Receipt events not triggeringReceipts not sentCall markAsDelivered()/markAsRead() explicitly
Memory leaksListeners holding Activity referenceAlways remove listeners in onDestroy()

Typing, Receipts & Reactions

SymptomCauseFix
Typing indicator stuckendTyping() not calledCall on send, focus loss, or after 3–5s timeout using a Handler
Double-tick not showingmarkAsDelivered() not calledCall on message fetch and real-time receive
Group receipts missingFeature not enabledEnable “Enhanced Messaging Status” in Dashboard
onMessagesDeliveredToAll/onMessagesReadByAll not firingNot registeredRegister these callbacks in MessageListener for group-level receipt events
Reaction not appearingUI not syncedCall updateMessageWithReactionInfo() on events
Duplicate reactionsNo check before addingUse getReactedByMe() first

AI Features

SymptomCauseFix
AI features not appearingNot enabledEnable in Dashboard → AI Features
AI Agents not respondingNot configuredConfigure Agent in Dashboard. Agents only respond to text
onAIAssistantEventReceived not firingListener not registeredRegister AIAssistantListener after login
Moderation always PENDINGRules not configuredConfigure rules in Dashboard → Moderation → Rules
Agentic messages not arrivingWrong listenerUse MessageListener with onAIAssistantMessageReceived

Upgrading from V3

SymptomCauseFix
Build fails after upgradeOld artifact still in GradleReplace com.cometchat:chat-sdk-android:3.x.x with com.cometchat:chat-sdk-android:4.x.x
Calls SDK not workingWrong artifact versionUse com.cometchat:calls-sdk-android:4.x.x
Both versions installedGradle conflictRemove the v3 dependency and sync project

Error Codes

For the complete SDK error code reference, see Error Codes. Common errors you’ll encounter:
CodeDescriptionResolution
ERR_UID_NOT_FOUNDUser doesn’t existCreate user via Dashboard or REST API
AUTH_ERR_AUTH_TOKEN_NOT_FOUNDInvalid or expired auth tokenGenerate new token via REST API
MISSING_PARAMETERSRequired parameter not providedCheck method signature and pass all required params
NOT_INITIALIZEDinit() not calledCall CometChat.init() before any other method
USER_NOT_LOGGED_INNo active sessionCall login() first
ERR_GUID_NOT_FOUNDGroup doesn’t existCreate group or verify GUID
ERR_NOT_A_MEMBERNot a group memberJoin group first
TOO_MANY_REQUESTRate limit exceededSee Rate Limits
FAILED_TO_FETCHNetwork issueCheck internet connection and API endpoint
NO_WEBSOCKET_CONNECTIONWebSocket disconnectedCheck connection status, wait for reconnect

Next Steps

Setup SDK

Installation and initialization guide

Best Practices

Recommended patterns and practices

Error Codes

Complete SDK error code reference

AI Integration

AI Agents, Moderation, and Copilot

Support

Open a support ticket