cometchat-android-v5-troubleshooting

$npx mdskill add cometchat/cometchat-skills/cometchat-android-v5-troubleshooting

Diagnose and fix CometChat Android integration problems systematically.

  • Resolves Gradle build errors, runtime crashes, and blank chat screens.
  • Depends on CometChat UIKit SDK, Android SDK, and official docs.
  • Analyzes stack traces, logs, and version mismatches to identify root cause.
  • Provides step-by-step fixes, ProGuard rules, and compatibility checks.

SKILL.md

.github/skills/cometchat-android-v5-troubleshootingView on GitHub ↗
---
name: cometchat-android-v5-troubleshooting
description: "Diagnose and fix problems with a CometChat Android integration. Gradle errors, runtime crashes, rendering issues, and version compatibility."
license: "MIT"
compatibility: "Android 7.0+; Java 8+; Kotlin 1.8+; com.cometchat:chat-uikit-android:5.x"
metadata:
  author: "CometChat"
  version: "3.0.0"
  tags: "cometchat android troubleshooting fix diagnose errors crashes gradle proguard"
---

> **Ground truth:** `com.cometchat:chat-uikit-android:5.x` (legacy/maintenance-only; +`calls-sdk-android:5.x`) — resolved AAR (javap) + `ui-kit/android`. **Official docs:** https://www.cometchat.com/docs/ui-kit/android/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.

> **Companion skills:** `cometchat-android-v5-core` covers correct init/login patterns;
> `cometchat-android-v5-production` covers ProGuard rules.

## Purpose

This skill teaches how to diagnose CometChat Android integration problems systematically. It covers Gradle build errors, runtime crashes, rendering issues, and version compatibility.

---

## Use this skill when

- "CometChat isn't working"
- "I'm getting a build error"
- "The chat screen is blank"
- "Messages aren't loading"
- Gradle sync failures
- Runtime crashes with CometChat in the stack trace

## Do not use this skill when

- Setting up a new integration → use `cometchat-android-v5-core`
- Customizing appearance → use `cometchat-android-v5-theming`

---

## 1. Common issues

| Symptom | Likely cause | Fix |
|---|---|---|
| `Could not resolve com.cometchat:chat-uikit-android` | Missing Maven repo | Add `maven { url "https://dl.cloudsmith.io/public/cometchat/cometchat/maven/" }` to repositories |
| `Duplicate class com.cometchat.*` | Multiple CometChat versions | Check dependency tree: `./gradlew app:dependencies` |
| Blank conversation list | Not logged in, or no conversations exist | Verify `getLoggedInUser() != null`. Send a test message from dashboard. |
| `CometChatException: ERR - Authentication null` | `init()` not called or failed | Call `init()` before `login()`. Check `isSDKInitialized()`. |
| `CometChatException: appIdErr` | App ID not set in UIKitSettings | Verify `setAppId()` in UIKitSettingsBuilder |
| Components show but no data | Login succeeded but wrong region | Verify region matches dashboard: `"us"`, `"eu"`, `"in"` |
| `ClassNotFoundException` in release build | ProGuard stripping CometChat classes | Add `-keep class com.cometchat.** { *; }` to proguard-rules.pro |
| `UnsupportedOperationException: Failed to resolve attribute` when inflating CometChat views | App theme inherits `Theme.AppCompat.*` or `Theme.Material3.*` — the kit's attrs are resolved against Material 2 (`CometChatTheme.DayNight` itself parents on `Theme.MaterialComponents.DayNight.NoActionBar`) | Change app theme parent to `CometChatTheme.DayNight` |
| `NetworkOnMainThreadException` | Calling CometChat sync methods on main thread | Use callbacks (all CometChat methods are async) |
| `minSdkVersion 21` error | CometChat requires API 24+ | Set `minSdkVersion 24` in build.gradle |
| Message list shows wrong messages | `setUser()`/`setGroup()` called with wrong object | Verify UID/GUID matches the intended conversation |
| Calling buttons not showing | Calling SDK not added | Add `com.cometchat:calls-sdk-android:5.+` dependency (matches `-core`/`-features`) |
| `java.lang.NoSuchMethodError` | Version mismatch between UI Kit and Chat SDK | Use compatible versions — UI Kit 5.x requires Chat SDK 4.x |

---

## 2. Diagnostic steps

1. **Check init:** `CometChatUIKit.isSDKInitialized()` — must be `true`
2. **Check login:** `CometChatUIKit.getLoggedInUser()` — must not be `null`
3. **Check Gradle:** `./gradlew app:dependencies | grep cometchat` — verify versions
4. **Check manifest:** Verify `INTERNET` permission
5. **Check region:** Must match dashboard exactly
6. **Check logs:** Filter logcat for `CometChat` tag

---

## Hard rules

- **Always check init + login first.** 90% of "it's not working" issues are init/login failures.
- **Never guess at the cause.** Check logcat, check the dependency tree, check the dashboard.
- **ProGuard is the #1 release-build issue.** Always add keep rules before the first release build.

More from cometchat/cometchat-skills

SkillDescription
cometchatEntry-point for CometChat integration in any React, React Native, Angular, Android, Flutter, or iOS project — web (React/Next.js/React Router/Astro), React Native (Expo/bare), Angular (12-15), native Android (V6 stable, V5 legacy), Flutter (V6 stable, V5 legacy), and native iOS (V5 stable). Detects the framework, gathers requirements through an interactive conversation, and writes production-quality integration code.
cometchat-a11yAccessibility (a11y) for CometChat UI Kit integrations across all families — React, React Native, Angular, Android (V5/V6), iOS, Flutter. Covers WCAG 2.1 AA targets, keyboard navigation in chat, screen reader announcements (live regions for new messages), color contrast, focus management on call screens, motion-reduction support, and the cross-family checks that catch the common production a11y bugs. Cross-family — applies wherever the agent is checking accessibility.
cometchat-android-v5Entry-point dispatcher for CometChat Android UI Kit v5. Detects project setup, understands what the dev is building, and routes to the right sub-skills.
cometchat-android-v5-callsCometChat Calls SDK v5 integration for native Android (V5 stable, Java + Kotlin Views). Covers SDK setup (Cloudsmith Maven, CallAppSettings, init), the dual-SDK ringing pattern (Chat SDK initiateCall + Calls SDK joinSession), session settings, event listeners, call logs, recording, screen sharing, picture-in-picture, foreground service for ongoing calls, VoIP push via FCM + ConnectionService, audio/video/participant controls, custom UI, and in-call chat. Use in standalone mode (calls is the product) or additive mode (calls layered on top of an existing CometChat Android v5 chat integration).
cometchat-android-v5-componentsComplete catalog of CometChat Android UI Kit v5 components. Reference before writing integration code — never invent component names.
cometchat-android-v5-coreFoundational rules for CometChat Android UI Kit v5. Initialization, login, UIKitSettings builder, dependency setup, and anti-patterns. Read this first.
cometchat-android-v5-customizationCustomize CometChat components beyond theming — custom message templates, DataSource decorators, event listeners, and custom view slots.
cometchat-android-v5-extensionsExtension architecture for CometChat Android — ExtensionsDataSource, decorators, built-in extensions, and how to create custom extensions.
cometchat-android-v5-featuresAdd features (calls, reactions, polls, file sharing, AI, etc.) to an already-integrated CometChat project. Routes to the right sub-flow based on feature type.
cometchat-android-v5-placementWhere to put CometChat in your Android app — Activity, Fragment, BottomSheet, Dialog, Tab, or embedded patterns.