cometchat/cometchat-uikit-flutter/cometchat-flutter-troubleshooting
Claude Code and agent skill by cometchat/cometchat-uikit-flutter
- community
Checking that the SKILL.md file is still in the repository.
Diagnose and fix CometChat Flutter UIKit v6 integration problems. Covers init failures, login errors, UI rendering issues, keyboard problems, call failures, listener leaks, theme jank, and platform-specific build errors. Use when seeing errors, crashes, or unexpected behavior with CometChat components.
Install
npx vskill@latest install cometchat/cometchat-uikit-flutter/cometchat-flutter-troubleshootingSKILL.md
The same SKILL.md was published earlier as cometchat/cometchat-uikit-flutter/cometchat-flutter-troubleshooting.
CometChat Flutter UIKit v6 — Troubleshooting Guide
Comprehensive guide for diagnosing and fixing CometChat Flutter UIKit v6 integration problems.
1. Quick Diagnosis Flow
Use this decision tree to jump to the right section:
2. Init & Login Errors
2.1 "Authentication null"
- Symptom: Error message
Authentication nullorPlease log in to CometChat before calling this methodwhen using any CometChat component or SDK call. - Cause:
CometChatUIKit.init()was not called, or was called but not awaited before using components or calling login. - Fix: Ensure
init()completes before any other CometChat usage:
2.2 "APP ID null"
- Symptom: Error
APP ID nullorappId is requiredduring init. - Cause:
appIdnot set inUIKitSettingsBuilder. - Fix: Set
appIdbefore calling.build():
2.3 ERR_ALREADY_LOGGED_IN
- Symptom: Error
ERR_ALREADY_LOGGED_INwhen callingCometChatUIKit.login(). - Cause: Calling login when a session already exists. After
init(), the SDK restores cached sessions automatically. - Fix: Check
CometChatUIKit.loggedInUserafter init before calling login:
CometChatUIKit.loginWithAuthToken does not use this code. With a user already logged in it calls onSuccess only for the auth token the SDK already holds; any other token gets onError with ERR_USER_ALREADY_LOGGED_IN (and a null return). Same fix: check CometChatUIKit.loggedInUser first, and CometChatUIKit.logout() before logging in as another user.
2.4 "Android internal error" on login
- Symptom: Login fails with a vague
Android internal errormessage. - Cause: Multiple possible causes — incorrect auth key, UID doesn't exist in CometChat dashboard, beta SDK bug, or network issue.
- Fix:
- Verify credentials are correct in the CometChat dashboard
- Verify the UID exists in the dashboard
- Try calling
CometChat.login(uid, authKey)directly to isolate UIKit vs SDK issue - If using beta SDK, try the stable release
- Check network connectivity and firewall rules
2.5 Guard screen stuck on spinner
- Symptom: App shows a loading spinner forever after init. The auth guard never resolves.
- Cause: Using the callback-based
CometChat.getLoggedInUser()after init instead of the synchronousCometChatUIKit.loggedInUser. The callback API silently fails when no session exists — neitheronSuccessnoronErrorfires. - Fix: Use the synchronous check after init:
2.6 Region error (ERR_INVALID_REGION)
- Symptom: Init fails with
ERR_INVALID_REGION. - Cause: Region string is uppercase or not one of the valid values.
- Fix: Use lowercase region string — valid values are
'us','eu','in':
2.7 StateError from uninitialized ServiceLocator
- Symptom:
StateError: not initializedwhen creating a BLoC manually. - Cause: Component's
ServiceLocator.instance.setup()was not called before creating the BLoC. UIKit widgets do this automatically, but manual BLoC creation requires it. - Fix: Call setup before creating the BLoC:
3. UI Rendering Issues
3.1 Double keyboard compensation (layout jumps)
- Symptom: When the keyboard opens, the message list jumps or there's extra white space. Content shifts twice — once from Flutter's Scaffold resize, once from the composer's internal keyboard handling.
- Cause: The
ScaffoldcontainingCometChatMessageComposerhasresizeToAvoidBottomInsetset totrue(the default). The composer handles keyboard spacing internally viaSliverSpacing. Both systems react to the keyboard, causing double-compensation. - Fix: Set
resizeToAvoidBottomInset: falseon any Scaffold containing the composer:
This applies everywhere the composer is used: messages screen, thread screen, or any custom screen.
3.2 Stale user/group data
- Symptom: User name, avatar, or group info doesn't update in real-time. Old data persists even after changes.
- Cause: Passing
widget.userorwidget.groupdirectly to UIKit components instead of maintaining mutable state that updates from listeners. - Fix: Keep mutable
_user/_groupin your State class and update from SDK listeners:
3.3 No typing indicators / presence events
- Symptom: Online/offline status never updates. Typing indicators don't appear. No presence events fire. No error is thrown.
- Cause:
subscriptionTypewas not set inUIKitSettingsBuilder. Omitting it silently disables all presence events. - Fix: Always set
subscriptionType:
3.4 Messages not updating in real-time
- Symptom: New messages don't appear until the screen is refreshed or re-opened.
- Cause: Multiple possible causes:
- SDK message listener not registered (BLoC handles this automatically — check component is mounted)
subscriptionTypenot set (see 3.3)- Component was disposed and listener removed
- Fix:
- Ensure
subscriptionTypeis set in UIKitSettings - Verify the
CometChatMessageListwidget is mounted and not disposed - If using custom BLoC, ensure it registers
CometChat.addMessageListener()in its constructor and removes it inclose()
3.5 Theme jank during keyboard animation
- Symptom: Visible jank (stuttering, dropped frames) when the keyboard opens or closes, especially on message screens.
- Cause: Theme values (
CometChatThemeHelper.getColorPalette(context), etc.) are being looked up insidebuild(). During keyboard animation,MediaQuerychanges trigger rebuilds, and each lookup does expensive InheritedWidget traversal (44–95ms instead of <16ms). - Fix: Cache theme values in
didChangeDependencies()with a_themeInitializedflag:
3.6 Extra white space between composer and keyboard
- Symptom: Visible gap between the message composer and the keyboard when it opens.
- Cause: Safe area bottom padding being applied when the keyboard is open. The keyboard already covers the safe area, so adding safe area padding on top creates extra space.
- Fix: Always use
MediaQuery.paddingOf(context).bottomfor safe area (set once indidChangeDependencies()). Never overwrite it with native plugin values. TheSliverSpacingwidget handles this automatically — ensure you're not adding extraSafeAreawrappers around the composer.
4. Call Issues
4.1 "auth token null" on call init
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cometchat-flutter-troubleshooting/SKILL.md
Popularity
- Repository stars
- 520
- Repository forks
- 42
- 7-day trend score
- 31
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cometchat/cometchat-uikit-flutter/cometchat-flutter-troubleshooting)