Skip to main content

Initialization and Login

SymptomCauseFix
CometChatUIKit.init() fails silentlyInvalid App ID, Region, or Auth KeyDouble-check credentials from the CometChat Dashboard
Blank screen after loginComponent rendered before init() or login() completesEnsure init()login() order completes before rendering any UI Kit component. See Methods
Component renders but shows no dataUser not logged inCall CometChatUIKit.login("UID") after init resolves
Login fails with “UID not found”UID doesn’t exist in your CometChat appCreate the user via Dashboard, SDK, or REST API first
CometChatUIKit.loggedInUser returns nullUser not logged in or session expiredCall login() or loginWithAuthToken() first
Auth Key exposed in productionUsing Auth Key instead of Auth TokenSwitch to loginWithAuthToken() for production. Generate tokens server-side via the REST API

Theming and Styling

SymptomCauseFix
Theme not appliedThemeExtension not added to MaterialAppAdd CometChat style extensions to your ThemeData.extensions list
Dark mode not workingBrightness not detectedCometChat theme uses MediaQuery.platformBrightnessOf(context). Ensure your MaterialApp supports dark mode
Custom colors not applyingOverriding wrong style classCheck Component Styling for the correct style class per component
Component-level style ignoredStyle object not passed correctlyEnsure you pass the style to the style property, not as a ThemeExtension
Styles apply in light mode but not darkOnly light theme configuredConfigure both light and dark themes in MaterialApp with separate ThemeData instances
Bubble style not applyingStyle linked to wrong directionDefine separate styles for CometChatOutgoingMessageBubbleStyle and CometChatIncomingMessageBubbleStyle — changing one does not affect the other

Components

SymptomCauseFix
Component not renderinginit() or login() not completeEnsure both complete before building any CometChat widget
Message list is emptyInvalid User or Group objectFetch the user or group via the SDK before passing it to the component
onThreadRepliesClick not firingCallback not setPass the callback to CometChatMessageList(onThreadRepliesClick: ...)
Custom template not renderingTemplate key doesn’t match messageEnsure type and category on your template match the message’s type and category exactly
addTemplate not overriding defaultTemplate appended, not replacedaddTemplate appends to the list. The template map uses last-write-wins by category_type key, so your template must have the same key to override
Keyboard covers composerresizeToAvoidBottomInset not setSet resizeToAvoidBottomInset: true on your Scaffold
Swipe-to-reply not workingDisabled or message not eligibleCheck enableSwipeToReply is true, message has a valid ID, and is not deleted or an action message
Audio playback issuesMultiple audio statesThe UI Kit uses AudioStateManager internally. Ensure you’re not conflicting with other audio players

Calling

SymptomCauseFix
Call buttons not appearingCalls not enabledEnsure enableCalls = true is set in your UIKitSettingsBuilder
Incoming call screen not showingCall listener not registeredEnsure CometChat.addCallListener() is called in your app initialization
Call connects but no audio/videoMissing permissionsRequest camera and microphone permissions before initiating calls

Extensions

SymptomCauseFix
Extension feature not appearingExtension not activated in DashboardEnable the specific extension from your Dashboard
Stickers not showingSticker extension not enabledActivate Sticker Extension in Dashboard
Polls option missingPolls extension not enabledActivate Polls Extension in Dashboard
Link preview not renderingLink Preview extension not enabledActivate Link Preview Extension in Dashboard

BLoC and State Management

SymptomCauseFix
BLoC already closed errorExternal BLoC disposed prematurelyIf you provide a custom BLoC via messageListBloc, ensure it outlives the widget
State not updating after BLoC eventEvent dispatched to wrong BLoC instanceEnsure you’re dispatching events to the same BLoC instance the widget is using
Duplicate messages appearingMultiple BLoC instances for same conversationUse a single BLoC instance per conversation. Don’t create a new one on every rebuild

Localization

SymptomCauseFix
UI text not translatedLocale not setEnsure your MaterialApp has the correct locale and supportedLocales configured
String overrides not appearingWrong keyVerify the key matches exactly. See Localize

Sound

SymptomCauseFix
No sound playsSound disabledCheck disableSoundForMessages is not set to true
Custom sound not playingAsset not foundEnsure the sound file is added to your pubspec.yaml assets and the path is correct

Text Formatters

SymptomCauseFix
Mentions render as plain textFormatter not addedPass CometChatMentionsFormatter() in the textFormatters list
textFormatters has no effectEmpty list passedAdd at least one formatter to the list
Markdown not renderingMarkdownTextFormatter not includedAdd MarkdownTextFormatter() to your textFormatters list or use RichTextConfiguration on the composer

Events

SymptomCauseFix
Event listener not firingSubscribed to wrong event classCheck the Events page for exact event class names
Duplicate event triggersMultiple registrations without cleanupRemove listeners when the widget is disposed
Listener ID collisionNon-unique listener tagUse a unique string for each listener registration