Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
cometchat avatar

Cometchat Android V6 Troubleshooting

  • 5 installs
  • 70 repo stars
  • Updated June 23, 2026
  • cometchat/cometchat-skills

Diagnoses and fixes common CometChat v6 issues across both Kotlin Views and Jetpack Compose stacks with a diagnostic table.

About

This skill provides a diagnostic table and fixes for common CometChat v6 problems across both the Kotlin Views and Jetpack Compose stacks. A developer uses it when init or login errors occur or components fail to render correctly.

  • Diagnostic table covering both Views and Compose stacks
  • Fixes for init/login errors and rendering problems

Cometchat Android V6 Troubleshooting by the numbers

  • 5 all-time installs (skills.sh)
  • Ranked #441 of 596 Debugging skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cometchat/cometchat-skills --skill cometchat-android-v6-troubleshooting

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs5
repo stars70
Last updatedJune 23, 2026
Repositorycometchat/cometchat-skills

What it does

Diagnoses and fixes common CometChat v6 issues across both Kotlin Views and Jetpack Compose stacks with a diagnostic table.

Files

SKILL.mdMarkdownGitHub ↗
Companion skills: cometchat-android-v6-core (init/login), cometchat-android-v6-compose-theming, cometchat-android-v6-kotlin-theming, cometchat-android-v6-push

Purpose

Diagnose and fix common issues with CometChat Android UIKit v6 across both Kotlin Views and Jetpack Compose stacks.

Use this skill when

  • Encountering errors during SDK initialization or login
  • Components not rendering or displaying incorrectly
  • Push notifications not working
  • Call features not functioning
  • Build or dependency issues

Do not use this skill when

  • Setting up a new project (use cometchat-android-v6-core)
  • Looking for component APIs (use cometchat-*-components)

1. Diagnostic Table

SymptomLikely CauseFix
Authentication null error on initUIKitSettings not configuredEnsure setAppId() and setRegion() are called on builder
APP ID null error on initMissing app IDCall setAppId("YOUR_APP_ID") on UIKitSettingsBuilder
Login fails with auth errorInvalid authKey or UIDVerify authKey from CometChat dashboard; check UID exists
Components show no dataSDK not initialized or user not logged inCheck CometChatUIKit.isSDKInitialized() and getLoggedInUser()
Compose components crashMissing CometChatTheme {} wrapperWrap all CometChat composables in CometChatTheme {}
Views theme colors wrongXML attrs not setInherit Activity theme from CometChatTheme.DayNight (see -kotlin-placement); for brand colors override cometchat* attrs in the Activity theme or call CometChatTheme.setPrimaryColor(...)
IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant) at MaterialCardView.<init> (typically from CometChatConversations.<init>)Activity theme parent is Theme.AppCompat.* or android:Theme.*Switch themes.xml parent to CometChatTheme.DayNight (NOT Theme.MaterialComponents.*.Bridge — Bridge drops Material widget defaults and triggers the MaterialButton crash below)
UnsupportedOperationException: Failed to resolve attribute at index N at MaterialButton.<init> (during inflate of kit-internal layout)Activity theme is Theme.MaterialComponents.* (or .Bridge) but missing cometchat* attrsSwitch themes.xml parent to CometChatTheme.DayNight — the kit's own theme supplies every cometchat* attr its internal layouts reference
Dark mode not applied (Compose)Using lightColorScheme() alwaysUse if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()
Dark mode not applied (Views)Theme cache staleCall CometChatTheme.clearCache() on configuration change
Messages not loadingUser/Group not set on componentCall setUser(user) or pass user parameter before display
Push notifications not receivedMissing google-services.jsonAdd file to app module root; verify Firebase project config
FCM token not registeredonNewToken() not calledManually request token with FirebaseMessaging.getInstance().token
Call notifications not showingVoIP permissions missingRequest READ_PHONE_STATE, MANAGE_OWN_CALLS, ANSWER_PHONE_CALLS
Calls SDK not initializedenableCalling not setSet setEnableCalling(true) on UIKitSettingsBuilder
CometChatCalls class not foundMissing calls SDK dependencyAdd com.cometchat:calls-sdk-android to dependencies
Build fails with duplicate classesConflicting annotation libsAdd exclude(group = "org.jetbrains", module = "annotations-java5") to configurations
compileSdk errorSDK too lowSet compileSdk = 36
minSdk errorAPI level too lowSet minSdk = 28 — v6 requires Android 9.0+
Compose preview crashesMissing preview dataUse the preview/ package helpers for @Preview composables
WebSocket disconnects in backgroundNo lifecycle managementCall CometChat.connect() on foreground, disconnect() on background
Recomposition issuesUnstable state in composablesEnsure state is hoisted properly; use remember and derivedStateOf
BubbleFactory not appliedWrong factory keyVerify getCategory() and getType() match the message's category and type
Style not applied (Compose)Using constructor instead of default()Use StyleClass.default(param = value) not StyleClass(...)

2. Initialization Issues

2.1 Verify SDK State

// Check initialization
Log.d("CometChat", "SDK initialized: ${CometChatUIKit.isSDKInitialized()}")
Log.d("CometChat", "Calls SDK initialized: ${CometChatUIKit.isCallsSDKInitialized()}")
Log.d("CometChat", "Logged in user: ${CometChatUIKit.getLoggedInUser()?.uid}")

2.2 Common Init Sequence Issues

// ❌ Wrong: init in every Activity
class ChatActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        CometChatUIKit.init(this, settings, callback) // DON'T DO THIS
    }
}

// ✅ Correct: init once in Application or splash
class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        CometChatUIKit.init(this, settings, callback)
    }
}

3. Compose-Specific Issues

3.1 Missing Theme Wrapper

// ❌ Crash: CompositionLocal not provided
setContent {
    CometChatConversations() // Will crash or look wrong
}

// ✅ Correct
setContent {
    CometChatTheme {
        CometChatConversations()
    }
}

3.2 Nested Theme Wrappers

// ❌ Unnecessary nesting
CometChatTheme {
    NavHost(...) {
        composable("chat") {
            CometChatTheme { // Don't nest
                CometChatMessageList(user = user)
            }
        }
    }
}

// ✅ Single wrapper at top level
CometChatTheme {
    NavHost(...) {
        composable("chat") {
            CometChatMessageList(user = user)
        }
    }
}

4. Views-Specific Issues

4.1 Theme Attributes Not Resolving

// If colors are all 0/transparent, the XML attrs aren't set
// Fix: Set programmatically
CometChatTheme.setPrimaryColor(Color.parseColor("#6851D6"))
// Or add attrs to your Activity's theme in styles.xml

4.2 RecyclerView Scroll Issues

If message list doesn't scroll properly, ensure the layout gives it flexible height:

<!-- ✅ Use layout_weight for flexible height -->
<CometChatMessageList
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1" />

5. Push Notification Issues

5.1 SDK Not Initialized in FCM Service

// When app is killed and FCM wakes it, SDK may not be initialized
override fun onMessageReceived(message: RemoteMessage) {
    if (!CometChatUIKit.isSDKInitialized()) {
        // Cannot handle message — show basic notification or skip
        return
    }
    // Safe to proceed
}

5.2 VoIP Permission Check

// All three permissions are required for VoIP
val hasPermissions = CometChatVoIP.hasReadPhoneStatePermission(context) &&
    CometChatVoIP.hasManageOwnCallsPermission(context) &&
    CometChatVoIP.hasAnswerPhoneCallsPermission(context)

6. Dependency Conflicts

6.1 Jetbrains Annotations Conflict

// In build.gradle.kts
configurations.all {
    exclude(group = "org.jetbrains", module = "annotations-java5")
}

6.2 Maven Repository Missing

// In settings.gradle
repositories {
    maven { url = uri("https://dl.cloudsmith.io/public/cometchat/cometchat/maven/") }
}

7. Release-build Issues (R8 / ProGuard)

7.1 ClassNotFoundException on release builds

Symptom: App works in debug, crashes on release with java.lang.ClassNotFoundException: com.cometchat.uikit.compose... (or kotlin... package). R8 has stripped kit classes that look unused via reflection.

Fix: Add to app/proguard-rules.pro:

# Keep all CometChat UIKit and chat-sdk classes
-keep class com.cometchat.** { *; }
-keepclassmembers class com.cometchat.** { *; }
-dontwarn com.cometchat.**

If you use the calls SDK, also add:

-keep class io.dyte.** { *; }
-dontwarn io.dyte.**

7.2 BuildConfig field missing in release

Symptom: BuildConfig.COMETCHAT_APP_ID resolves to empty string in release. Caused by local.properties not being copied during CI builds.

Fix: Provide credentials via Gradle properties from CI environment vars instead of relying on local.properties:

// app/build.gradle.kts
android {
    defaultConfig {
        buildConfigField(
            "String", "COMETCHAT_APP_ID",
            "\"${project.findProperty("cometchat.appId") ?: System.getenv("COMETCHAT_APP_ID") ?: ""}\""
        )
        // …same for region + authKey
    }
}

In CI (e.g. GitHub Actions), set COMETCHAT_APP_ID etc. as repository secrets, not as files.

Hard rules

  • ALWAYS check isSDKInitialized() before making SDK calls in background services (FCM, VoIP)
  • ALWAYS wrap Compose components in CometChatTheme {} — this is the #1 cause of Compose rendering issues
  • Call CometChatTheme.clearCache() in Views when the theme changes dynamically
  • Do NOT lower minSdk below 28 or compileSdk below 36
  • When reporting bugs, include: SDK version, stack (Compose/Views), Android API level, and the full stack trace

Related skills

Debuggingintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.