agentsclimarketplace

Cometchat flutter v5 troubleshooting

Skill cometchat/cometchat-skills/skills/cometchat-flutter-v5-troubleshooting

Add CometChat chat & messaging and voice & video calls to any React, Next.js, React Native, Angular, Android, iOS, or Flutter project through your AI coding agent. Works with Claude Code, Cursor, Codex, VS Code Copilot, Windsurf, Cline, Kiro, and 50+ more agents.

Install
npx -y skills add cometchat/cometchat-skills --skill cometchat-flutter-v5-troubleshooting

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

Use when debugging CometChat Flutter UIKit v5 issues. Symptom-to-cause lookup, verify checks, common errors, drift detection.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

8.1 KB, as published. Nobody here has run it

Ground truth: cometchat_chat_uikit: ^5.2 (legacy/maintenance-only; calls via raw cometchat_calls_sdk ^5.0.2) — pub-cache source + ui-kit/flutter/v5. Official docs: https://www.cometchat.com/docs/ui-kit/flutter/v5/overview · Docs MCP: claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.

CometChat Flutter UIKit v5 — Troubleshooting

Symptom-to-cause lookup and verification checks.

Init / Login Issues

SymptomCauseFix
"Authentication null"CometChatUIKit.init() not calledCall init before login/components
"APP ID null"appId not set in UIKitSettingsBuilderSet ..appId = 'YOUR_APP_ID'
Login hangs silentlyinit() hasn't completed yetAwait init completion via onSuccess before calling login
"ERR_INVALID_REGION"Uppercase regionUse lowercase: 'us', 'eu', 'in'
Login succeeds but no messages loadsubscriptionType not setSet ..subscriptionType = CometChatSubscriptionType.allUsers

UI / Layout Issues

SymptomCauseFix
Theme jank during keyboard animationCometChatThemeHelper.getColorPalette(context) called in build()Cache in didChangeDependencies()
Components don't reflect theme changesUsing _themeInitialized flagRemove flag — cache unconditionally in didChangeDependencies()
Hardcoded colors don't match dark modeUsing Color(0xFF...) instead of theme tokensUse colorPalette.primary, colorPalette.textPrimary, etc.
colorPalette.white doesn't change in dark modewhite/black/transparent are NOT brightness-awareUse colorPalette.neutral50 for brightness-aware white

GetX Issues

SymptomCauseFix
"GetX controller not found"Using Get.find() before Get.put()Let UIKit components manage their own controllers
Controller not disposedManually created controller without cleanupUse controllerTag or let widget manage lifecycle
Multiple controller instancesCreating controller outside the widgetLet the widget's initState() handle Get.put()
Get.delete() throwsDeleting controller that was created with controllerTagOnly delete if controllerTag was null (widget-managed)

Listener / Event Issues

SymptomCauseFix
Duplicate events firingListener not removed in dispose()Always remove with same ID used to register
Listener ID collisionHardcoded listener ID stringUse timestamp: 'id_${DateTime.now().millisecondsSinceEpoch}'
No typing indicatorssubscriptionType not setSet CometChatSubscriptionType.allUsers
No online/offline statussubscriptionType not setSame fix
ccMessageSent not firingUsing CometChat.sendMessage() directlyUse CometChatUIKit.sendTextMessage() instead
Events fire after screen disposedListener not removedRemove in dispose() / onClose()

Call Issues

SymptomCauseFix
Incoming call overlay doesn't showCallNavigationContext.navigatorKey not setSet on MaterialApp.navigatorKey
Call buttons don't appearCometChatCallingExtension not registeredSet ..callingExtension = CometChatCallingExtension() on UIKitSettingsBuilder
Call fails silentlyCamera/microphone permissions not grantedRequest Permission.camera and Permission.microphone
Incoming calls not handledCall listener not registered globallyRegister CallListener + CometChatCallEventListener at dashboard level

Push Notification Issues

SymptomCauseFix
No push notificationsToken not registeredCall CometChatNotifications.registerPushToken(PushPlatforms.FCM_FLUTTER_ANDROID, fcmToken: token, ...) after login (PNRegistry.registerPNService is a v5 sample-app extension, not a kit API — must be copied in; see cometchat-flutter-v5-push)
Notifications after logoutToken not unregisteredCall CometChatNotifications.unregisterPushToken(onSuccess:, onError:) before logout
Duplicate notificationsForeground notification shown for active conversationCheck conversationId match before showing
VoIP call notification doesn't showBackground handler not top-levelUse @pragma('vm:entry-point') on top-level function
Tap doesn't navigateCallNavigationContext.navigatorKey.currentContext is nullEnsure navigatorKey is set on MaterialApp
iOS VoIP token not registeredMissing VoIP background modeEnable Voice over IP in Xcode Background Modes

Android Build Issues

SymptomCauseFix
Release build crashMissing ProGuard keep rulesAdd -keep class com.cometchat.** { *; }
Build fails with minSdk errorminSdk too lowSet minSdk 24 in android/app/build.gradle (matches vendor sample apps; bump to 26 ONLY if calls + min-SDK runtime errors)
AndroidX conflictMissing AndroidX migrationSet BOTH android.useAndroidX=true AND android.enableJetifier=true in gradle.properties

iOS Build Issues

SymptomCauseFix
Camera/mic permission crashMissing Info.plist entriesAdd NSCameraUsageDescription, NSMicrophoneUsageDescription
Pod install failsCocoapods version mismatchRun pod repo update then pod install

Callback Signature Errors

SymptomCauseFix
Type error on CometChatUsers.onItemTapMissing BuildContext parameterSignature is Function(BuildContext, User)?
Type error on CometChatGroups.onItemTapMissing BuildContext parameterSignature is Function(BuildContext, Group)?
Type error on CometChatConversations.onItemTapExtra BuildContext parameterSignature is Function(Conversation)? — no BuildContext
Type error on CometChatGroupMembers.onItemTapExtra BuildContext parameterSignature is Function(GroupMember)? — no BuildContext

v5 vs v6 Drift Detection

If you see any of these in a v5 project, it's a v6 pattern that was accidentally used:

v6 Pattern (wrong in v5)v5 Equivalent
import 'package:flutter_bloc/flutter_bloc.dart'GetX — no BLoC in v5
extends Bloc<Event, State>extends GetxController
extends EquatableNot used in v5
ServiceLocator.get<T>()Get.find<T>() or let widget manage
Single cometchat_chat_uikit with calls built-inSeparate cometchat_calls_uikit package
Per-component style classes (e.g. CometChatConversationsStyle, CometChatMessageListStyle) + theme via CometChatThemePer-widget feature flags only (no BuilderSettings/BuilderColor/BuilderTypography in v5 — those are v4 leftovers)
enableCalls: true + CallingConfiguration() on UIKitSettingsBuilder..callingExtension = CometChatCallingExtension()

Verify Checklist

Run through this when something isn't working:

  • CometChatUIKit.init() completes before any other CometChat call
  • subscriptionType set in UIKitSettingsBuilder
  • region is lowercase
  • Theme cached in didChangeDependencies(), not build()
  • All listeners registered with unique IDs
  • All listeners removed in dispose() / onClose()
  • CallNavigationContext.navigatorKey set on MaterialApp
  • CometChatCallingExtension() set if using calls
  • Push tokens registered after login
  • Push tokens unregistered before logout
  • ProGuard rules present for release builds
  • No v6 imports (flutter_bloc, equatable, BlocProvider / BlocBuilder)

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.