@cometchat/skills 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -17
  3. package/bin/install.js +389 -43
  4. package/package.json +19 -9
  5. package/skills/cometchat/SKILL.md +1066 -265
  6. package/skills/cometchat-android-v5/SKILL.md +120 -0
  7. package/skills/cometchat-android-v5-components/SKILL.md +430 -0
  8. package/skills/cometchat-android-v5-core/SKILL.md +468 -0
  9. package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
  10. package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
  11. package/skills/cometchat-android-v5-features/SKILL.md +130 -0
  12. package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
  13. package/skills/cometchat-android-v5-production/SKILL.md +94 -0
  14. package/skills/cometchat-android-v5-push/SKILL.md +620 -0
  15. package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
  16. package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
  17. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
  18. package/skills/cometchat-android-v6/SKILL.md +107 -0
  19. package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
  20. package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
  21. package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
  22. package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
  23. package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
  24. package/skills/cometchat-android-v6-core/SKILL.md +354 -0
  25. package/skills/cometchat-android-v6-events/SKILL.md +212 -0
  26. package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
  27. package/skills/cometchat-android-v6-features/SKILL.md +130 -0
  28. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
  29. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
  30. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
  31. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
  32. package/skills/cometchat-android-v6-production/SKILL.md +187 -0
  33. package/skills/cometchat-android-v6-push/SKILL.md +274 -0
  34. package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
  35. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
  36. package/skills/cometchat-angular-components/SKILL.md +706 -0
  37. package/skills/cometchat-angular-core/SKILL.md +444 -0
  38. package/skills/cometchat-angular-customization/SKILL.md +424 -0
  39. package/skills/cometchat-angular-features/SKILL.md +447 -0
  40. package/skills/cometchat-angular-patterns/SKILL.md +447 -0
  41. package/skills/cometchat-angular-placement/SKILL.md +685 -0
  42. package/skills/cometchat-angular-production/SKILL.md +415 -0
  43. package/skills/cometchat-angular-theming/SKILL.md +365 -0
  44. package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
  45. package/skills/cometchat-astro-patterns/SKILL.md +3 -3
  46. package/skills/cometchat-components/SKILL.md +11 -0
  47. package/skills/cometchat-core/SKILL.md +11 -6
  48. package/skills/cometchat-customization/references/component-catalog.md +1 -1
  49. package/skills/cometchat-features/SKILL.md +176 -108
  50. package/skills/cometchat-flutter-v5/SKILL.md +167 -0
  51. package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
  52. package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
  53. package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
  54. package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
  55. package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
  56. package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
  57. package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
  58. package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
  59. package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
  60. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
  61. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
  62. package/skills/cometchat-flutter-v6/SKILL.md +445 -0
  63. package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
  64. package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
  65. package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
  66. package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
  67. package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
  68. package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
  69. package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
  70. package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
  71. package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
  72. package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
  73. package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
  74. package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
  75. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
  76. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
  77. package/skills/cometchat-ios/SKILL.md +323 -0
  78. package/skills/cometchat-ios-components/SKILL.md +651 -0
  79. package/skills/cometchat-ios-core/SKILL.md +822 -0
  80. package/skills/cometchat-ios-customization/SKILL.md +825 -0
  81. package/skills/cometchat-ios-features/SKILL.md +725 -0
  82. package/skills/cometchat-ios-placement/SKILL.md +750 -0
  83. package/skills/cometchat-ios-production/SKILL.md +730 -0
  84. package/skills/cometchat-ios-push/SKILL.md +582 -0
  85. package/skills/cometchat-ios-theming/SKILL.md +631 -0
  86. package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
  87. package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
  88. package/skills/cometchat-native-components/SKILL.md +594 -0
  89. package/skills/cometchat-native-core/SKILL.md +407 -0
  90. package/skills/cometchat-native-customization/SKILL.md +594 -0
  91. package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
  92. package/skills/cometchat-native-features/SKILL.md +608 -0
  93. package/skills/cometchat-native-placement/SKILL.md +500 -0
  94. package/skills/cometchat-native-production/SKILL.md +694 -0
  95. package/skills/cometchat-native-push/SKILL.md +593 -0
  96. package/skills/cometchat-native-testing/SKILL.md +583 -0
  97. package/skills/cometchat-native-theming/SKILL.md +656 -0
  98. package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
  99. package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
  100. package/skills/cometchat-production/SKILL.md +60 -0
  101. package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
@@ -0,0 +1,249 @@
1
+ ---
2
+ name: cometchat-android-v6-troubleshooting
3
+ description: "CometChat Android UIKit v6 troubleshooting — diagnostic table, common issues, and fixes for both Kotlin Views and Compose stacks"
4
+ license: "MIT"
5
+ compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-compose-android:6.x / com.cometchat:chatuikit-kotlin-android:6.x"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.1"
10
+ tags: "cometchat, android, troubleshooting, debugging, errors, issues"
11
+ ---
12
+
13
+ > **Companion skills:** cometchat-android-v6-core (init/login), cometchat-android-v6-compose-theming, cometchat-android-v6-kotlin-theming, cometchat-android-v6-push
14
+
15
+ ## Purpose
16
+
17
+ Diagnose and fix common issues with CometChat Android UIKit v6 across both Kotlin Views and Jetpack Compose stacks.
18
+
19
+ ## Use this skill when
20
+
21
+ - Encountering errors during SDK initialization or login
22
+ - Components not rendering or displaying incorrectly
23
+ - Push notifications not working
24
+ - Call features not functioning
25
+ - Build or dependency issues
26
+
27
+ ## Do not use this skill when
28
+
29
+ - Setting up a new project (use `cometchat-android-v6-core`)
30
+ - Looking for component APIs (use `cometchat-*-components`)
31
+
32
+ ## 1. Diagnostic Table
33
+
34
+ | Symptom | Likely Cause | Fix |
35
+ |---|---|---|
36
+ | `Authentication null` error on init | `UIKitSettings` not configured | Ensure `setAppId()` and `setRegion()` are called on builder |
37
+ | `APP ID null` error on init | Missing app ID | Call `setAppId("YOUR_APP_ID")` on `UIKitSettingsBuilder` |
38
+ | Login fails with auth error | Invalid authKey or UID | Verify authKey from CometChat dashboard; check UID exists |
39
+ | Components show no data | SDK not initialized or user not logged in | Check `CometChatUIKit.isSDKInitialized()` and `getLoggedInUser()` |
40
+ | Compose components crash | Missing `CometChatTheme {}` wrapper | Wrap all CometChat composables in `CometChatTheme {}` |
41
+ | Views theme colors wrong | XML attrs not set | Inherit Activity theme from `CometChatTheme.DayNight` (see `-kotlin-placement`); for brand colors override `cometchat*` attrs in the Activity theme or call `CometChatTheme.setPrimaryColor(...)` |
42
+ | `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) |
43
+ | `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*` attrs | Switch `themes.xml` parent to `CometChatTheme.DayNight` — the kit's own theme supplies every `cometchat*` attr its internal layouts reference |
44
+ | Dark mode not applied (Compose) | Using `lightColorScheme()` always | Use `if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()` |
45
+ | Dark mode not applied (Views) | Theme cache stale | Call `CometChatTheme.clearCache()` on configuration change |
46
+ | Messages not loading | User/Group not set on component | Call `setUser(user)` or pass `user` parameter before display |
47
+ | Push notifications not received | Missing `google-services.json` | Add file to app module root; verify Firebase project config |
48
+ | FCM token not registered | `onNewToken()` not called | Manually request token with `FirebaseMessaging.getInstance().token` |
49
+ | Call notifications not showing | VoIP permissions missing | Request READ_PHONE_STATE, MANAGE_OWN_CALLS, ANSWER_PHONE_CALLS |
50
+ | Calls SDK not initialized | `enableCalling` not set | Set `setEnableCalling(true)` on `UIKitSettingsBuilder` |
51
+ | `CometChatCalls` class not found | Missing calls SDK dependency | Add `com.cometchat:calls-sdk-android` to dependencies |
52
+ | Build fails with duplicate classes | Conflicting annotation libs | Add `exclude(group = "org.jetbrains", module = "annotations-java5")` to configurations |
53
+ | `compileSdk` error | SDK too low | Set `compileSdk = 36` |
54
+ | `minSdk` error | API level too low | Set `minSdk = 28` — v6 requires Android 9.0+ |
55
+ | Compose preview crashes | Missing preview data | Use the `preview/` package helpers for `@Preview` composables |
56
+ | WebSocket disconnects in background | No lifecycle management | Call `CometChat.connect()` on foreground, `disconnect()` on background |
57
+ | Recomposition issues | Unstable state in composables | Ensure state is hoisted properly; use `remember` and `derivedStateOf` |
58
+ | BubbleFactory not applied | Wrong factory key | Verify `getCategory()` and `getType()` match the message's category and type |
59
+ | Style not applied (Compose) | Using constructor instead of `default()` | Use `StyleClass.default(param = value)` not `StyleClass(...)` |
60
+
61
+ ## 2. Initialization Issues
62
+
63
+ ### 2.1 Verify SDK State
64
+
65
+ ```kotlin
66
+ // Check initialization
67
+ Log.d("CometChat", "SDK initialized: ${CometChatUIKit.isSDKInitialized()}")
68
+ Log.d("CometChat", "Calls SDK initialized: ${CometChatUIKit.isCallsSDKInitialized()}")
69
+ Log.d("CometChat", "Logged in user: ${CometChatUIKit.getLoggedInUser()?.uid}")
70
+ ```
71
+
72
+ ### 2.2 Common Init Sequence Issues
73
+
74
+ ```kotlin
75
+ // ❌ Wrong: init in every Activity
76
+ class ChatActivity : AppCompatActivity() {
77
+ override fun onCreate(savedInstanceState: Bundle?) {
78
+ CometChatUIKit.init(this, settings, callback) // DON'T DO THIS
79
+ }
80
+ }
81
+
82
+ // ✅ Correct: init once in Application or splash
83
+ class MyApp : Application() {
84
+ override fun onCreate() {
85
+ super.onCreate()
86
+ CometChatUIKit.init(this, settings, callback)
87
+ }
88
+ }
89
+ ```
90
+
91
+ ## 3. Compose-Specific Issues
92
+
93
+ ### 3.1 Missing Theme Wrapper
94
+
95
+ ```kotlin
96
+ // ❌ Crash: CompositionLocal not provided
97
+ setContent {
98
+ CometChatConversations() // Will crash or look wrong
99
+ }
100
+
101
+ // ✅ Correct
102
+ setContent {
103
+ CometChatTheme {
104
+ CometChatConversations()
105
+ }
106
+ }
107
+ ```
108
+
109
+ ### 3.2 Nested Theme Wrappers
110
+
111
+ ```kotlin
112
+ // ❌ Unnecessary nesting
113
+ CometChatTheme {
114
+ NavHost(...) {
115
+ composable("chat") {
116
+ CometChatTheme { // Don't nest
117
+ CometChatMessageList(user = user)
118
+ }
119
+ }
120
+ }
121
+ }
122
+
123
+ // ✅ Single wrapper at top level
124
+ CometChatTheme {
125
+ NavHost(...) {
126
+ composable("chat") {
127
+ CometChatMessageList(user = user)
128
+ }
129
+ }
130
+ }
131
+ ```
132
+
133
+ ## 4. Views-Specific Issues
134
+
135
+ ### 4.1 Theme Attributes Not Resolving
136
+
137
+ ```kotlin
138
+ // If colors are all 0/transparent, the XML attrs aren't set
139
+ // Fix: Set programmatically
140
+ CometChatTheme.setPrimaryColor(Color.parseColor("#6851D6"))
141
+ // Or add attrs to your Activity's theme in styles.xml
142
+ ```
143
+
144
+ ### 4.2 RecyclerView Scroll Issues
145
+
146
+ If message list doesn't scroll properly, ensure the layout gives it flexible height:
147
+
148
+ ```xml
149
+ <!-- ✅ Use layout_weight for flexible height -->
150
+ <CometChatMessageList
151
+ android:layout_width="match_parent"
152
+ android:layout_height="0dp"
153
+ android:layout_weight="1" />
154
+ ```
155
+
156
+ ## 5. Push Notification Issues
157
+
158
+ ### 5.1 SDK Not Initialized in FCM Service
159
+
160
+ ```kotlin
161
+ // When app is killed and FCM wakes it, SDK may not be initialized
162
+ override fun onMessageReceived(message: RemoteMessage) {
163
+ if (!CometChatUIKit.isSDKInitialized()) {
164
+ // Cannot handle message — show basic notification or skip
165
+ return
166
+ }
167
+ // Safe to proceed
168
+ }
169
+ ```
170
+
171
+ ### 5.2 VoIP Permission Check
172
+
173
+ ```kotlin
174
+ // All three permissions are required for VoIP
175
+ val hasPermissions = CometChatVoIP.hasReadPhoneStatePermission(context) &&
176
+ CometChatVoIP.hasManageOwnCallsPermission(context) &&
177
+ CometChatVoIP.hasAnswerPhoneCallsPermission(context)
178
+ ```
179
+
180
+ ## 6. Dependency Conflicts
181
+
182
+ ### 6.1 Jetbrains Annotations Conflict
183
+
184
+ ```kotlin
185
+ // In build.gradle.kts
186
+ configurations.all {
187
+ exclude(group = "org.jetbrains", module = "annotations-java5")
188
+ }
189
+ ```
190
+
191
+ ### 6.2 Maven Repository Missing
192
+
193
+ ```kotlin
194
+ // In settings.gradle
195
+ repositories {
196
+ maven { url = uri("https://dl.cloudsmith.io/public/cometchat/cometchat/maven/") }
197
+ }
198
+ ```
199
+
200
+ ## 7. Release-build Issues (R8 / ProGuard)
201
+
202
+ ### 7.1 `ClassNotFoundException` on release builds
203
+
204
+ **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.
205
+
206
+ **Fix:** Add to `app/proguard-rules.pro`:
207
+
208
+ ```proguard
209
+ # Keep all CometChat UIKit and chat-sdk classes
210
+ -keep class com.cometchat.** { *; }
211
+ -keepclassmembers class com.cometchat.** { *; }
212
+ -dontwarn com.cometchat.**
213
+ ```
214
+
215
+ If you use the calls SDK, also add:
216
+
217
+ ```proguard
218
+ -keep class io.dyte.** { *; }
219
+ -dontwarn io.dyte.**
220
+ ```
221
+
222
+ ### 7.2 `BuildConfig` field missing in release
223
+
224
+ **Symptom:** `BuildConfig.COMETCHAT_APP_ID` resolves to empty string in release. Caused by `local.properties` not being copied during CI builds.
225
+
226
+ **Fix:** Provide credentials via Gradle properties from CI environment vars instead of relying on `local.properties`:
227
+
228
+ ```kotlin
229
+ // app/build.gradle.kts
230
+ android {
231
+ defaultConfig {
232
+ buildConfigField(
233
+ "String", "COMETCHAT_APP_ID",
234
+ "\"${project.findProperty("cometchat.appId") ?: System.getenv("COMETCHAT_APP_ID") ?: ""}\""
235
+ )
236
+ // …same for region + authKey
237
+ }
238
+ }
239
+ ```
240
+
241
+ In CI (e.g. GitHub Actions), set `COMETCHAT_APP_ID` etc. as repository secrets, not as files.
242
+
243
+ ## Hard rules
244
+
245
+ - ALWAYS check `isSDKInitialized()` before making SDK calls in background services (FCM, VoIP)
246
+ - ALWAYS wrap Compose components in `CometChatTheme {}` — this is the #1 cause of Compose rendering issues
247
+ - Call `CometChatTheme.clearCache()` in Views when the theme changes dynamically
248
+ - Do NOT lower `minSdk` below 28 or `compileSdk` below 36
249
+ - When reporting bugs, include: SDK version, stack (Compose/Views), Android API level, and the full stack trace