Skip to main content

Repro — enableCalling: true without the Calls SDK crashes the app at launch

Kit: com.cometchat:chatuikit-compose-android:6.0.5 (crash path is in the shared chatuikit-core, so chatuikit-kotlin-android is affected identically) Device: Pixel 8 emulator, API 36 · Observed: 2026-08-21

Steps

  1. New Android app, minSdk 28, Kotlin DSL. Add the CometChat maven to settings.gradle.kts:
  2. Add only the UI Kit — deliberately no calls-sdk-android:
  3. Create app/src/main/assets/cometchat-settings.json with valid credentials and the calling flag ON. Credentials must be valid — the crash occurs after chat init succeeds:
  4. In MainActivity.onCreate, call init — nothing else is required:
  5. Build, install, launch.

Expected

Either init succeeds with calling silently unavailable, or onError fires with an actionable message naming the missing dependency.

Actual

Process dies in onCreate, before any UI renders. Neither onSuccess nor onError is called — the throw escapes the callback.

Confirming the cause

Set "enableCalling": false, change nothing else, rebuild → init OK then login OK, app runs normally. Flip it back → crash returns.

Why it matters

  • The symptom (app will not start at all) is maximally distant from the cause (one boolean in a JSON asset). Nothing in the flag’s name implies a Gradle dependency.
  • It compiles cleanly, so no build-time gate can catch it.
  • It is trivially hit by copying cometchat-settings.json between projects — which is how it was found here.
  • onError is not invoked, so an app that correctly handles init failure still dies.

Suggested fix

Guard initCometChatCalls so a missing Calls SDK routes to callbackListener.onError(...) with a message naming the required dependency, rather than propagating NoClassDefFoundError. Unlike the CometChatCallLogs case (where a missing dependency legitimately cannot work), here calling is an optional feature the app may never use — a launch crash is disproportionate.