Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Ground truth:CometChatUIKitSwift ~> 5 (+ CometChatCallsSDK ~> 5) — Pods/SPM .swiftinterface + ui-kit/ios. Official docs:https://www.cometchat.com/docs/ui-kit/ios/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.
Purpose
This skill helps diagnose and fix common issues when integrating CometChat iOS UI Kit. It covers build errors, runtime errors, and debugging techniques.
1. Build Errors
"No such module 'CometChatUIKitSwift'"
Cause: SDK not installed or not linked properly.
Solutions:
CocoaPods:
# Clean and reinstallcd /path/to/your/project
rm -rf Pods Podfile.lock
pod install --repo-update
# Open workspace (not project!)
open YourApp.xcworkspace
Swift Package Manager:
In Xcode, go to File → Packages → Reset Package Caches
File → Packages → Resolve Package Versions
Clean build folder: Cmd + Shift + K
Build again
Check Podfile:
platform :ios, '13.0'
use_frameworks!
target 'YourApp'do
pod 'CometChatUIKitSwift', '~> 5.1'end
"No such module 'CometChatSDK'"
Cause: Core SDK not installed alongside UI Kit.
Solution: The UI Kit should include the SDK automatically. If not:
# Podfile
pod 'CometChatUIKitSwift', '~> 5.1'
pod 'CometChatSDK', '~> 4.0'# Add explicitly if needed
"No such module 'CometChatCallsSDK'"
Cause: Calls SDK not installed but code references it.
Solutions:
If you need calls:
# Podfile
pod 'CometChatCallsSDK', '~> 5.0'
If you don't need calls:
Wrap call-related code in conditional compilation:
"Value of type 'CometChatException' has no member 'localizedDescription'"
Cause: Using wrong property for error description.
Solution: Use errorDescription instead of localizedDescription:
case .onError(let error):
print(error.errorDescription)
print(error.errorCode)
CometChatException has:
errorDescription — human-readable error message
errorCode — error code string
details — optional dictionary with additional info
"'CometChatException' is not convertible to 'any Error'"
Cause: Trying to use CometChatException with Swift's Result<T, Error> type.
Solution:CometChatException does NOT conform to Swift's Error protocol. Don't use Result<T, Error> with CometChat callbacks. Instead, use direct callbacks:
// tier2-expect-error — this block intentionally demonstrates the compile error below// ❌ WRONG - Don't use Result<T, Error>funclogin(completion: @escaping (Result<User, Error>) -> Void) {
CometChatUIKit.login(uid: uid) { result inswitch result {
case .success(let user):
completion(.success(user))
case .onError(let error):
completion(.failure(error)) // ERROR: CometChatException is not Error
}
}
}
// ✅ CORRECT - Use CometChatException directlyfunclogin(completion: @escaping (User?, CometChatException?) -> Void) {
CometChatUIKit.login(uid: uid) { result inswitch result {
case .success(let user):
completion(user, nil)
case .onError(let error):
completion(nil, error)
@unknowndefault:
completion(nil, nil)
}
}
}
"Cannot find 'CometChatConversationsWithMessages' in scope" or "Cannot find 'CometChatMessages' in scope"
Cause: Neither class exists in the kit. They look like "pre-built composite UIViewControllers" but are NOT exported from CometChatUIKitSwift. Older docs and AI-generated guides sometimes claim they exist.
Solution: Compose your own MessagesVC from the real building blocks (CometChatMessageHeader + CometChatMessageList + CometChatMessageComposer). The pattern is the same one the kit's sample app uses (SampleApp/View Controllers/CometChat Components/MessagesVC.swift).
import CometChatUIKitSwift
import CometChatSDK
let conversations =CometChatConversations()
let navController =UINavigationController(rootViewController: conversations)
conversations.set(onItemClick: { [weak navController] conversation, _inlet messagesVC =MessagesVC() // your own VC composing CometChatMessageHeader + List + Composeriflet group = conversation.conversationWith as?Group {
messagesVC.set(group: group)
} elseiflet user = conversation.conversationWith as?User {
messagesVC.set(user: user)
}
navController?.pushViewController(messagesVC, animated: true)
})
See cometchat-ios-components § 13 ("Custom MessagesVC Implementation") for the full MessagesVC source.
"Cannot find 'CometChatCallLogs' in scope"
Cause:CometChatCallLogs requires CometChatCallsSDK which is not installed.
Solutions:
Install the Calls SDK:
# Podfile
pod 'CometChatCallsSDK', '~> 5.0'
Or wrap in conditional compilation:
#if canImport(CometChatCallsSDK)
let callLogs =CometChatCallLogs()
#else// Show placeholder or hide calls tab#endif
"Duplicate symbols" or "Multiple commands produce"
Cause: Conflicting dependencies or duplicate frameworks.
Solutions:
Clean derived data:
rm -rf ~/Library/Developer/Xcode/DerivedData
Check for duplicate pods:
pod deintegrate
pod install
Check Build Phases:
Go to Target → Build Phases → Link Binary With Libraries
Remove any duplicate frameworks
"The iOS deployment target is set to X.X, but the range of supported deployment target versions is Y.Y to Z.Z"
Cause: Minimum iOS version mismatch.
Solution:
Update your project's deployment target to iOS 13.0 or higher
Update Podfile:
platform :ios, '13.0'
Run:
pod install
"Sandbox: rsync.samba denied"
Cause: Xcode sandbox permission issue (common in Xcode 15+).
Solution:
Disable User Script Sandboxing in Build Settings:
Select your app target
Go to Build Settings
Search for "User Script Sandboxing"
Set ENABLE_USER_SCRIPT_SANDBOXING to No
Or add to your Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO'endendend
Then run:
pod install
Clean and rebuild:
rm -rf ~/Library/Developer/Xcode/DerivedData
"Framework not found" during archive
Cause: Framework search paths issue.
Solution:
Go to Target → Build Settings
Search for "Framework Search Paths"
Add: $(inherited) and $(PROJECT_DIR)/Pods
Set "Build Active Architecture Only" to No for Release
2. Runtime Errors
"CometChat is not initialized"
Cause: Trying to use CometChat before initialization completes.
Solution:
// ❌ Wrong - using before init completesCometChatUIKit(uiKitSettings: settings) { _in }
let conversations =CometChatConversations() // Too early!// ✅ Correct - wait for completionCometChatUIKit(uiKitSettings: settings) { result inswitch result {
case .success:
DispatchQueue.main.async {
let conversations =CometChatConversations()
// Now safe to use
}
case .failure(let error):
print("Init failed: \(error)")
}
}
"Invalid App ID" or "App not found"
Cause: Wrong App ID or region.
Solutions:
Verify App ID in CometChat Dashboard
Check region matches (us, eu, or in)
Ensure no extra spaces in credentials
let uiKitSettings =UIKitSettings()
.set(appID: "YOUR_APP_ID") // No spaces!
.set(region: "us") // Lowercase
.build()
"Invalid Auth Key"
Cause: Wrong or expired Auth Key.
Solutions:
Get fresh Auth Key from Dashboard → API & Auth Keys
Use the correct key type (Auth Key, not REST API Key)
Check for copy/paste errors
"User not found" or "UID not found"
Cause: Trying to login with a UID that doesn't exist.
Solutions:
Use pre-created test users:
cometchat-uid-1 through cometchat-uid-5
Create user first:
let user =User(uid: "new-user-123", name: "John Doe")
CometChatUIKit.create(user: user) { result inswitch result {
case .success(let user):
// Now loginCometChatUIKit.login(uid: user.uid ??"") { _in }
case .onError(let error):
print("Create failed: \(error)")
}
}
"Already logged in"
Cause: Calling login when user is already logged in.
Solution:
// Check for existing session firstiflet currentUser =CometChatUIKit.getLoggedInUser() {
print("Already logged in as: \(currentUser.name ??"")")
// Proceed to chat UI
} else {
// LoginCometChatUIKit.login(uid: "user-123") { _in }
}
Blank/Empty Conversation List
Cause: No conversations exist for the logged-in user.
Solutions:
Send a test message:
Go to CometChat Dashboard → Users
Select another user
Send a message to your logged-in user
Check user is logged in:
iflet user =CometChatUIKit.getLoggedInUser() {
print("Logged in as: \(user.uid ??"")")
} else {
print("Not logged in!")
}
Correct environment? Development vs Production certificate must match
Calls Not Working
Cause: Missing SDK or permissions.
Checklist:
CometChatCallsSDK installed?
pod 'CometChatCallsSDK', '~> 5.0'
Permissions in Info.plist?
<key>NSCameraUsageDescription</key><string>Camera access for video calls</string><key>NSMicrophoneUsageDescription</key><string>Microphone access for calls</string>
Background modes enabled?
Audio, AirPlay, and Picture in Picture
Voice over IP
Testing on real device? Calls don't work on simulator
Did you call CometChatCalls.login(...)? ⚠️ On iOS there is NO CometChatCalls.login — the iOS CometChatCallsSDK has no login/joinSession/SessionSettingsBuilder. The authority is the vendored CometChatCallsSDK.swiftinterface (generateToken / startSession / CallSettingsBuilder / CallsEventsDelegate). The calls-sdk-ios repo's own skills/ describe a different API and will mislead you — don't follow them. Default calling works through the UI Kit (CometChatUIKit calling-enabled) without a separate calls login; for custom calling, use generateToken → startSession.
Background push for calls not arriving (Privacy manifest / APNs vs FCM)
Cause: Missing privacy manifest, or an APNs-vs-FCM provider mismatch.
Fix:
Add a PrivacyInfo.xcprivacy privacy manifest to the app target (required by App Store review; its absence can also break some push/SDK behaviors).
Match the provider to your token type: if you registered an APNs device/VoIP token, the dashboard provider must be APNs (.p8 + Team ID + Key ID, dev-vs-prod environment matching the build); if you route iOS through FCM, register with the FCM provider and the FCM_IOS platform. A token registered against the wrong provider silently never delivers. See cometchat-ios-push.
// Always update UI on main threadCometChatUIKit.login(uid: "user-123") { result inDispatchQueue.main.async {
switch result {
case .success:
self.showConversations()
case .onError(let error):
self.showError(error)
}
}
}
3. Debugging Techniques
Inspect SDK errors
The CometChat iOS SDK has no public log-level API (there is no
CometChat.setLogLevel / AppSettingsBuilder logging toggle). Diagnose by
reading the CometChatException handed to each call's onError closure:
Check completion handlers: Wait for async operations
Inspect errors: read the CometChatException in each call's onError (errorCode + errorDescription) — the SDK has no log-level toggle
8. Theming Errors
"Value of type 'MessageBubbleStyle' has no member 'outgoingBackgroundColor'"
Cause: Incorrect property access for message bubble styles.
Solution: Message bubble styles use separate .incoming and .outgoing style objects, not combined properties:
// ✅ CORRECT - Use separate incoming/outgoing stylesCometChatMessageBubble.style.outgoing.backgroundColor =CometChatTheme.primaryColor
CometChatMessageBubble.style.incoming.backgroundColor =CometChatTheme.neutralColor300
// For text colors within bubblesCometChatMessageBubble.style.outgoing.textBubbleStyle.textColor = .white
CometChatMessageBubble.style.incoming.textBubbleStyle.textColor =CometChatTheme.textColorPrimary
"Value of type 'ConversationsStyle' has no member 'titleColor'"
Cause: Using incorrect property names for component styles.
Solution: Check the actual property names in the style struct:
"Value of type 'BadgeStyle' has no member 'cornerRadius'" (type mismatch)
Cause:BadgeStyle.cornerRadius is CometChatCornerStyle?, not a simple value.
Solution:
// ✅ CORRECT - cornerRadius is optional CometChatCornerStyleCometChatBadge.style.cornerRadius =CometChatCornerStyle(cornerRadius: 8)
// or nil for default pill shapeCometChatBadge.style.cornerRadius =nil
"Cannot assign value of type 'UIColor' to type 'CGColor'"
Cause:BadgeStyle.borderColor is CGColor, not UIColor.
Solution:
// ✅ CORRECT - use .cgColorCometChatBadge.style.borderColor =UIColor.clear.cgColor
CometChatBadge.style.borderColor =UIColor.white.cgColor
Theme Changes Not Applying
Cause: Theme configured after UI is already displayed.
Solution: Configure theme before showing any CometChat UI:
// In AppDelegate or App init, BEFORE showing any CometChat viewsfuncconfigureTheme() {
CometChatTheme.primaryColor =UIColor.systemBlue
CometChatTheme.backgroundColor01 =UIColor.systemBackground
// ... other theme settings
}
// Call this before CometChatUIKit.init()
configureTheme()
"Type 'CometChatSpacing' has no member 'Spacing1'" or similar
Cause: Using incorrect property access for spacing values.
Solution:CometChatSpacing uses nested classes, not direct properties:
// ✅ CORRECT - Use nested class syntaxCometChatSpacing.Spacing.s1 =4CometChatSpacing.Spacing.s2 =8CometChatSpacing.Padding.p1 =4CometChatSpacing.Padding.p2 =8CometChatSpacing.Radius.r1 =4CometChatSpacing.Radius.r2 =8CometChatSpacing.Radius.rMax =1000CometChatSpacing.Margin.m1 =4
"Cannot infer type of closure parameter" or "Cannot infer contextual base"
Cause: Missing type annotations in closures for custom views.
Solution: Always provide explicit type annotations for closure parameters: