소스 정보
- 저장소
- tomevault-io/skills-registry
- 최근 소스 활동
- 2026년 7월 19일 15:30
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill cometchat-flutter-troubleshooting명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | cometchat-flutter-troubleshooting |
| description | > Use when this capability is needed. |
Comprehensive guide for diagnosing and fixing CometChat Flutter UIKit v6 integration problems.
Use this decision tree to jump to the right section:
What's happening?
│
├─ App crashes or errors on startup
│ └─ Go to → Section 2: Init & Login Errors
│
├─ UI looks wrong, layout broken, keyboard issues
│ └─ Go to → Section 3: UI Rendering Issues
│
├─ Calls not working, call screen blank or stuck
│ └─ Go to → Section 4: Call Issues
│
├─ Events not firing, duplicate events, memory leaks
│ └─ Go to → Section 5: Listener Issues
│
├─ Build fails on Android or iOS
│ └─ Go to → Section 6: Build Errors
│
├─ App is slow, janky scrolling, laggy keyboard
│ └─ Go to → Section 7: Performance Issues
│
└─ Platform-specific weirdness (Android/iOS/Web)
└─ Go to → Section 8: Platform-Specific Issues
Authentication null or Please log in to CometChat before calling this method when using any CometChat component or SDK call.CometChatUIKit.init() was not called, or was called but not awaited before using components or calling login.init() completes before any other CometChat usage:// ✅ CORRECT — await init before anything else
final settings = (UIKitSettingsBuilder()
..appId = 'APP_ID'
..region = 'us'
..authKey = 'AUTH_KEY'
..subscriptionType = CometChatSubscriptionType.allUsers)
.build();
await CometChatUIKit.init(
uiKitSettings: settings,
onSuccess: (_) => debugPrint('Init done'),
onError: (e) => debugPrint('Init failed: ${e.message}'),
);
// ❌ WRONG — login before init completes (race condition)
CometChatUIKit.init(uiKitSettings: settings);
CometChatUIKit.login('uid');
APP ID null or appId is required during init.appId not set in UIKitSettingsBuilder.appId before calling .build():final settings = (UIKitSettingsBuilder()
..appId = 'YOUR_APP_ID' // ← Must be set
..region = 'us'
..authKey = 'YOUR_AUTH_KEY')
.build();
ERR_ALREADY_LOGGED_IN when calling CometChatUIKit.login().init(), the SDK restores cached sessions automatically.CometChatUIKit.loggedInUser after init before calling login:CometChatUIKit.init(
uiKitSettings: settings,
onSuccess: (_) {
if (CometChatUIKit.loggedInUser != null) {
// Already logged in — skip login, go to home
navigateToHome();
} else {
// No session — show login screen
navigateToLogin();
}
},
);
Android internal error message.CometChat.login(uid, authKey) directly to isolate UIKit vs SDK issueCometChat.getLoggedInUser() after init instead of the synchronous CometChatUIKit.loggedInUser. The callback API silently fails when no session exists — neither onSuccess nor onError fires.// ✅ CORRECT — synchronous check, always resolves
CometChatUIKit.init(
uiKitSettings: settings,
onSuccess: (_) {
final hasUser = CometChatUIKit.loggedInUser != null;
setState(() {
_loggedIn = hasUser;
_initializing = false;
});
},
);
// ❌ WRONG — callback may never fire when no session exists
CometChatUIKit.init(
uiKitSettings: settings,
onSuccess: (_) {
CometChat.getLoggedInUser(
onSuccess: (user) { /* may never fire */ },
onError: (e) { /* may never fire */ },
);
},
);
// ❌ ALSO WRONG — redundant native bridge round-trip
CometChatUIKit.init(
uiKitSettings: settings,
onSuccess: (_) async {
final user = await CometChatUIKit.getLoggedInUser(); // Unnecessary!
},
);
ERR_INVALID_REGION.'us', 'eu', 'in':// ✅ CORRECT
..region = 'us'
// ❌ WRONG
..region = 'US'
..region = 'United States'
StateError: not initialized when creating a BLoC manually.ServiceLocator.instance.setup() was not called before creating the BLoC. UIKit widgets do this automatically, but manual BLoC creation requires it.// ✅ CORRECT
ConversationsServiceLocator.instance.setup();
final bloc = ConversationsBloc(
getLoggedInUserUseCase: ConversationsServiceLocator.instance.getLoggedInUserUseCase,
);
// ❌ WRONG — setup not called
final bloc = ConversationsBloc(
getLoggedInUserUseCase: ConversationsServiceLocator.instance.getLoggedInUserUseCase,
);
widget.user or widget.group directly to UIKit components instead of maintaining mutable state that updates from listeners._user/_group in your State class and update from SDK listeners:class _MessagesScreenState extends State<MessagesScreen> {
late User? _user;
late Group? _group;
@override
void initState() {
super.initState();
_user = widget.user;
_group = widget.group;
// Register listeners to update _user/_group on changes
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
Expanded(child: CometChatMessageList(user: _user, group: _group)),
CometChatMessageComposer(user: _user, group: _group),
],
),
);
}
}
subscriptionType was not set in UIKitSettingsBuilder. Omitting it silently disables all presence events.subscriptionType:// ✅ CORRECT
UIKitSettingsBuilder()
..appId = 'APP_ID'
..region = 'us'
..authKey = 'AUTH_KEY'
..subscriptionType = CometChatSubscriptionType.allUsers
// ❌ WRONG — no error, but presence events never fire
UIKitSettingsBuilder()
..appId = 'APP_ID'
..region = 'us'
..authKey = 'AUTH_KEY'
// subscriptionType missing!
subscriptionType not set (see 3.2)subscriptionType is set in UIKitSettingsCometChatMessageList widget is mounted and not disposedCometChat.addMessageListener() in its constructor and removes it in close()CometChatThemeHelper.getColorPalette(context), etc.) are being looked up inside build(). During keyboard animation, MediaQuery changes trigger rebuilds, and each lookup does expensive InheritedWidget traversal (44–95ms instead of <16ms).didChangeDependencies() with a _themeInitialized flag:// ✅ CORRECT — cache once, reuse on every build
class _MyWidgetState extends State<MyWidget> {
late CometChatColorPalette _colorPalette;
late CometChatSpacing _spacing;
late CometChatTypography _typography;
bool _themeInitialized = false;
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (!_themeInitialized) {
_colorPalette = CometChatThemeHelper.getColorPalette(context);
_spacing = CometChatThemeHelper.getSpacing(context);
_typography = CometChatThemeHelper.getTypography(context);
_themeInitialized = true;
}
}
@override
Widget build(BuildContext context) {
// Use _colorPalette, _spacing, _typography — no lookups here
return Container(color: _colorPalette.primary);
}
}
// ❌ WRONG — lookup in build causes jank during keyboard animation
@override
Widget build(BuildContext context) {
final colors = CometChatThemeHelper.getColorPalette(context); // Expensive!
return Container(color: colors.primary);
}
MediaQuery.paddingOf(context).bottom for safe area (set once in didChangeDependencies()). Never overwrite it with native plugin values. The SliverSpacing widget handles this automatically — ensure you're not adding extra SafeArea wrappers around the composer.auth token null or similar authentication error when trying to start a call.CometChatUIKit.init() and login complete before any calls-related initialization. The UIKit handles this order internally — if you're initializing calls manually, ensure the chat session is established first.session already started when trying to join or start a call.CometChat.endCall() or CometChat.rejectCall() to clean up the stale session before starting a new one.CallManager not found or CometChat Calling module not found.cometchat_chat_uikit is properly added to pubspec.yamlflutter clean and rebuildandroid.enableJetifier=true is in gradle.propertiesstartSession returns null on Android with no error feedback. The call screen may appear blank or stuck.startSession silently fails. A 5-second timeout workaround exists but provides no error feedback.startSession callscometchat_calls_sdk that may fix thissubscriptionType not set (presence/events disabled)subscriptionType is set to CometChatSubscriptionType.allUsersCometChatUIKit.logout(), the Calls SDK session is invalidated but may not be properly re-initialized on the next login.// ✅ CORRECT — unique ID per instance
class _MyScreenState extends State<MyScreen> with MessageListener {
late final String _listenerId;
@override
void initState() {
super.initState();
_listenerId = 'my_screen_${DateTime.now().millisecondsSinceEpoch}';
CometChat.addMessageListener(_listenerId, this);
}
@override
void dispose() {
CometChat.removeMessageListener(_listenerId);
super.dispose();
}
}
// ❌ WRONG — hardcoded ID causes collisions across instances
CometChat.addMessageListener('messages', this); // Collision!
initState() but not removed in dispose().@override
void dispose() {
CometChat.removeMessageListener(_listenerId);
CometChat.removeUserListener(_listenerId);
CometChat.removeGroupListener(_listenerId);
CometChat.removeCallListener(_listenerId);
super.dispose();
}
subscriptionType not set in UIKitSettingsBuilder. This silently disables all real-time events.subscriptionType during init:UIKitSettingsBuilder()
..subscriptionType = CometChatSubscriptionType.allUsers
ClassNotFoundException for CometChat classes. Debug builds work fine.android/app/proguard-rules.pro with:# CometChat — prevent R8 from stripping SDK classes
-keep class com.cometchat.** { *; }
-keep interface com.cometchat.** { *; }
# Suppress warnings for Calls SDK classes referenced cross-module
-dontwarn com.cometchat.calls.CometChatRTCView$CometChatRTCViewBuilder
-dontwarn com.cometchat.calls.CometChatRTCView
-dontwarn com.cometchat.calls.CometChatRTCViewListener
-dontwarn com.cometchat.calls.model.AnalyticsSettings
-dontwarn com.cometchat.calls.model.RTCCallback
-dontwarn com.cometchat.calls.model.RTCReceiver
Reference it in android/app/build.gradle:
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
minSdkVersion incompatibility.minSdk is set below 26. The cometchat_calls_sdk requires minSdk 26.android/app/build.gradle (or .kts):defaultConfig {
minSdk = 26 // Required by cometchat_calls_sdk
}
androidx conflicts.android.enableJetifier=true not set. Transitive dependencies from the CometChat SDK use old Android Support Library references.android/gradle.properties:android.useAndroidX=true
android.enableJetifier=true
pod install fails with dependency resolution errors, version conflicts, or missing pods.cd ios
rm -rf Pods Podfile.lock
pod repo update
pod install --repo-update
cd ..
flutter clean
flutter pub get
If still failing, check that the iOS deployment target in ios/Podfile is high enough:
platform :ios, '13.0' # Minimum for CometChat
Info.plist.ios/Runner/Info.plist:<key>NSCameraUsageDescription</key>
<string>Camera access is needed for video calls and sending photos</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is needed for voice and video calls</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo library access is needed for sending images</string>
For VoIP calls, also add:
<key>UIBackgroundModes</key>
<array>
<string>voip</string>
<string>remote-notification</string>
</array>
CometChatThemeHelper.getColorPalette(context) and similar calls in build() do expensive InheritedWidget traversal on every rebuild.didChangeDependencies() — see Section 3.4 for the full pattern. For child widgets, pass pre-cached theme values from the parent:// Parent passes cached values to children
CometChatImageBubble(
imageUrl: message.attachment?.fileUrl,
colorPalette: _colorPalette, // Pre-cached from parent
spacing: _spacing, // Pre-cached from parent
);
BlocConsumer or BlocBuilder without buildWhen — rebuilds on every state emission.buildWhen to limit rebuilds to relevant state changes:BlocConsumer<MessageComposerBloc, MessageComposerState>(
buildWhen: (previous, current) =>
previous.isEditMode != current.isEditMode ||
previous.isReplyMode != current.isReplyMode ||
previous.isRecordingMode != current.isRecordingMode ||
previous.editMessage != current.editMessage ||
previous.replyMessage != current.replyMessage,
listener: (context, state) { /* still receives ALL state changes */ },
builder: (context, state) { /* only rebuilds when buildWhen is true */ },
)
findChildIndexCallback takes too long.list.indexWhere() (O(n)) to find messages instead of a Map-based O(1) lookup.Map<int, int> alongside the message list for O(1) index lookups:// In BLoC — maintain O(1) lookup map
final Map<int, int> _messageIndexMap = {};
int? findMessageIndex(int messageId) => _messageIndexMap[messageId];
// In SliverAnimatedList
SliverAnimatedList(
findChildIndexCallback: (Key key) {
if (key is ValueKey<int>) {
final index = widget.findMessageIndex?.call(key.value) ??
_messages.indexWhere((m) => m.id == key.value);
if (index != -1) return visualPosition(index);
}
return null;
},
)
| Symptom | Cause | Fix |
|---|---|---|
Release crash ClassNotFoundException | Missing ProGuard rules | Add -keep class com.cometchat.** { *; } — see Section 6.1 |
Build fail minSdk | minSdk < 26 | Set minSdk = 26 in build.gradle |
| Build fail support library | Missing Jetifier | Add android.enableJetifier=true to gradle.properties |
startSession returns null | Known Calls SDK issue | Implement timeout + retry — see Section 4.4 |
CallManager not found | Native module not linked | Clean build + verify ProGuard + Jetifier — see Section 4.3 |
| Audio recording stuck after permission | Permission callback race | Ensure permission is granted before starting recording; handle the permission result callback properly |
| Symptom | Cause | Fix |
|---|---|---|
| Pod install fails | Stale cache or version conflict | rm -rf Pods Podfile.lock && pod install --repo-update |
| Camera/mic crash | Missing Info.plist permissions | Add NSCameraUsageDescription, NSMicrophoneUsageDescription — see Section 6.5 |
| Media not sending | File access or permission issue | Verify NSPhotoLibraryUsageDescription in Info.plist; check file picker permissions |
| App crash on iPhone 11 | Device-specific compatibility | Check iOS deployment target ≥ 13.0; verify no 32-bit dependencies |
| VoIP calls not received in background | Missing background modes | Add voip and remote-notification to UIBackgroundModes in Info.plist |
| Symptom | Cause | Fix |
|---|---|---|
| Runtime error on web | Platform-specific code without kIsWeb guard | Wrap platform-specific code with if (!kIsWeb) checks |
| Native plugins crash on web | Plugin not available on web | Use conditional imports or kIsWeb guards before calling native APIs |
| CORS errors | API calls blocked by browser | Ensure CometChat API endpoints are accessible; check proxy configuration |
// ✅ CORRECT — guard platform-specific code
import 'package:flutter/foundation.dart' show kIsWeb;
if (!kIsWeb) {
// Native-only code (e.g., push notifications, file system access)
setupPushNotifications();
}
// For conditional imports:
// lib/platform/native_service.dart — native implementation
// lib/platform/web_service.dart — web implementation
| Error / Symptom | Section | One-Line Fix |
|---|---|---|
| "Authentication null" | 2.1 | Call CometChatUIKit.init() before any usage |
| "APP ID null" | 2.2 | Set ..appId = 'YOUR_APP_ID' in UIKitSettingsBuilder |
| ERR_ALREADY_LOGGED_IN | 2.3 | Check CometChatUIKit.loggedInUser before calling login |
| "Android internal error" | 2.4 | Verify credentials, UID existence, try stable SDK |
| Guard screen stuck on spinner | 2.5 | Use CometChatUIKit.loggedInUser synchronously after init |
| ERR_INVALID_REGION | 2.6 | Use lowercase: 'us', 'eu', 'in' |
| StateError: not initialized | 2.7 | Call ServiceLocator.instance.setup() before creating BLoC |
| No typing indicators / presence | 3.2 | Set ..subscriptionType = CometChatSubscriptionType.allUsers |
| Theme jank during keyboard | 3.4 | Cache theme in didChangeDependencies(), not build() |
| Duplicate events | 5.1 | Use unique listener ID per widget instance |
| Listener leak | 5.2 | Remove listener in dispose() with same ID |
| ClassNotFoundException (release) | 6.1 | Add ProGuard keep rules for com.cometchat.** |
| minSdk too low | 6.2 | Set minSdk = 26 |
| Jetifier missing | 6.3 | Add android.enableJetifier=true |
| Pod install failure | 6.4 | Delete Pods + Podfile.lock, pod install --repo-update |
| Missing iOS permissions | 6.5 | Add camera/mic/photo descriptions to Info.plist |
Use this checklist to verify your integration is correct:
CometChatUIKit.init() called and awaited before any usageCometChatUIKit.loggedInUser after init (not CometChat.getLoggedInUser())subscriptionType set in UIKitSettingsBuilderregion is lowercase ('us', 'eu', 'in')didChangeDependencies(), not build()dispose()CometChatThemeHelper, never hardcodedTranslations.of(context), never hardcodedkIsWeb guards on platform-specific codeSource: cometchat/cometchat-uikit-flutter — distributed by TomeVault.