Cant Initialise CometChat after login in User

I have been trying to integrate cometchat into my application after user login but it keeps giving me an error. Here is my code below
private fun logChat() {
val UID: String? = FirebaseAuth.getInstance().currentUser?.uid // Replace with the UID
of the user to login
val AUTH_KEY = “a7cd1825ba915ecc3732c8896ae7f2f4fa9d4b5d” // Replace with your
App Auth Key
CometChat.login(UID.toString(), AUTH_KEY, object :
CometChat.CallbackListener<User?>() {
override fun onSuccess(user: User?) {


        override fun onError(e: CometChatException) {


CometChat.CallbackListener<User?>() is underlined in red, indicating error. It says

Type mismatch.

It doesnt indicate what was found> Please help me


We suggest you to restart Android Studio and sync the project once. This issues might happen if the project isn’t synced properly.


Hi, @apochi Hope you are doing well.

Hope this was helpful! I am closing out this ticket due to inactivity. Please feel free to write to us at if you require any further assistance.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.