Skip to main content
Quick Reference for AI Agents & DevelopersMigration Steps:
  1. Update Maven URL to https://dl.cloudsmith.io/public/cometchat/cometchat/maven/
  2. Update dependency to com.cometchat:chat-sdk-android:4.1.7 (or latest v4)
  3. Change all imports from com.cometchat.pro.* to com.cometchat.chat.*
  4. Rebuild and test your application
Key Changes:
  • Package name changed from com.cometchat.pro to com.cometchat.chat
  • Maven repository URL updated
  • API remains largely compatible with v3
Full guide: Follow the setup instructions for detailed v4 setup.
Upgrading from v3.x to v4 is straightforward. Below are the major changes released as part of CometChat v4: Follow the setup instructions to upgrade to the latest V4 version.

Maven URL Change

allprojects {
  repositories {
    maven {
      url "https://dl.cloudsmith.io/public/cometchat/cometchat/maven/"
    }
  }
}

Dependency Change

dependencies {
  implementation 'com.cometchat:chat-sdk-android:4.1.7'
}

Change the Import Class Packages

In v3, the import class package name starts with com.cometchat.pro.*. Change it to com.cometchat.chat.* everywhere in the project and you are done with the v3 to v4 migration.

Best Practices

After updating imports and dependencies, thoroughly test all CometChat functionality in your app. Pay special attention to initialization, authentication, messaging, and calling features.
Use your IDE’s find-and-replace feature to update all com.cometchat.pro imports to com.cometchat.chat across your entire project. Don’t miss any files.
While the API is largely compatible, review the v4 changelog for any breaking changes that might affect your specific use case. Test edge cases and error handling.
Ensure your project-level build.gradle includes the new Maven URL in the repositories section. Clean and rebuild your project after making changes.
Perform the migration in a separate git branch so you can easily revert if issues arise. Test thoroughly before merging to your main branch.

Troubleshooting

Symptom: Gradle sync or build fails with “Could not resolve com.cometchat:chat-sdk-android” error.Cause: Maven repository URL not updated in project-level build.gradle.Solution: Ensure the new Maven URL https://dl.cloudsmith.io/public/cometchat/cometchat/maven/ is added to the allprojects repositories section in your project-level build.gradle. Clean and rebuild the project.
Symptom: IDE shows “Cannot resolve symbol” errors for CometChat classes.Cause: Not all import statements were updated from com.cometchat.pro.* to com.cometchat.chat.*.Solution: Use your IDE’s find-and-replace feature to search for all occurrences of com.cometchat.pro and replace with com.cometchat.chat. Rebuild the project and resolve any remaining import errors manually.
Symptom: App builds successfully but crashes at runtime with ClassNotFoundException or similar errors.Cause: ProGuard/R8 rules may need updating, or some imports were missed.Solution: Update ProGuard rules to use the new package name com.cometchat.chat.*. Verify all imports are updated. Clean and rebuild the project. Check for any reflection-based code that might reference old package names.
Symptom: CometChat.init() fails with errors after migration.Cause: Incorrect App ID, Region, or Auth Key, or SDK not properly initialized.Solution: Verify your App ID and Region are correct in the initialization code. Ensure you’re using the v4 initialization pattern. Check that the SDK dependency was properly updated to v4. Review initialization logs for specific error messages.

Next Steps