--- name: cometchat-android-v6-core description: "Foundational rules for the CometChat Android UI Kit v6 — the two UI cohorts and their artifacts, credentials via the gitignored assets settings file, initFromSettings → login → render ordering, the component map, and the production-ready core chat surface. Read this first for any Android CometChat task. Triggers: CometChat Android setup, Kotlin chat UI kit, Jetpack Compose chat." license: "MIT" compatibility: "Android minSdk >=28; compileSdk >=36; Kotlin >=2.1; AGP >=8.9.1; JVM target 11; com.cometchat:chatuikit-kotlin-android ^6 (XML Views) OR com.cometchat:chatuikit-compose-android ^6 (Jetpack Compose) — 6.0.x, verified 6.0.5; com.cometchat:chat-sdk-android ^5 (5.0.x); optional com.cometchat:calls-sdk-android ^5" metadata: author: "CometChat" version: "1.1.0" tags: "chat cometchat android kotlin compose views core rules initialization native" --- > **Ground truth:** `com.cometchat:chatuikit-{kotlin,compose}-android@6` + catalog `android-v6.json` > (287 public symbols, generated from the INSTALLED 6.0.5 source) + `features.android-v6.json`. > Official docs: · scoped index > `…/ui-kit/android/llms-android-v6.md`. Verify every symbol against the catalog; fetch signatures > from docs (`references/docs-map.md`); never trust memory. > > ⚠️ **ONE kit, TWO cohorts.** `chatuikit-kotlin-android` (XML Views) and `chatuikit-compose-android` > (Jetpack Compose) are different artifacts with different namespaces. Component NAMES are shared, the > wiring is not — Views uses `setOnX(...)` setters, Compose uses `onX =` params. **Never install both.** > **v5 Java snippets do not compile against v6** (`com.cometchat.chatuikit.*` → `com.cometchat.uikit.*`); > that migration is `cometchat-android-v6-migration`. > > ⚠️ **Some docs snippets are ahead of / behind the shipped kit.** Where a baked signature here differs > from a docs page, the baked one was verified against the installed 6.0.5 source (gap logged > internally). Compile before you trust a docs fence. ## Use this skill when "add chat to my Android app", "set up CometChat credentials", "integrate CometChat in Kotlin/Compose", "show a conversations + messages screen", "build a chat app". An unscoped "add chat" means the **production-ready core chat surface** below — not a bare list, and not the whole tab-based app (that grows via `cometchat-android-v6-{kotlin,compose}-placement`). ## Prerequisites & install **Pick ONE cohort** — the app's existing UI stack decides: ```kotlin // settings.gradle.kts → dependencyResolutionManagement.repositories maven("https://dl.cloudsmith.io/public/cometchat/cometchat/maven/") // app/build.gradle.kts — repo/exclude/compileOptions are COHORT-NEUTRAL (the duplicate-class // collision comes via chatuikit-core-android, which BOTH cohorts pull); only the artifact differs configurations.all { // REQUIRED — without it the first build fails at dexing with ~40 // "Duplicate class org.jetbrains.annotations.*" errors (docs getting-started-{kotlin,jetpack}). exclude(group = "org.jetbrains", module = "annotations-java5") } // gradle.properties — REQUIRED, both lines (why: dexing dup-class; references/troubleshooting.md): // android.useAndroidX=true android.enableJetifier=true dependencies { implementation("com.cometchat:chatuikit-kotlin-android:6.0.5") // implementation("com.cometchat:calls-sdk-android:5.0.4") // only for voice/video } android { buildFeatures { viewBinding = true } compileOptions { sourceCompatibility = JavaVersion.VERSION_11; targetCompatibility = JavaVersion.VERSION_11 } } // JVM 11 (Kotlin 2.2+ rejects kotlinOptions{}). Fully-qualified: a mid-file .kts import won't compile. kotlin { compilerOptions { jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11) } } ``` **Theme kit views under a `CometChatTheme.DayNight`-derived theme — REQUIRED (Views), not cosmetic.** Kit views resolve `?attr/cometchat*` at inflate time; outside such a theme the FIRST kit view crashes (`IllegalArgumentException`/`InflateException` on `?attr/cometchatPrimaryColor` — verified on device). **Greenfield** → re-parent app-wide: `