Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to create any new channels. #5262

Open
Yatish1910 opened this issue May 16, 2024 · 2 comments
Open

Not able to create any new channels. #5262

Yatish1910 opened this issue May 16, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Yatish1910
Copy link

Describe the bug
When we are trying to create new channels with given members it is throwing error:

ThrowableError(message=, cause=java.lang.NoSuchMethodError: No direct method <init>(Lio/getstream/chat/android/models/User;Ljava/util/Date;Ljava/util/Date;Ljava/lang/Boolean;Ljava/util/Date;Ljava/util/Date;ZZLjava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V in class Lio/getstream/chat/android/models/Member; or its super classes (declaration of 'io.getstream.chat.android.models.Member' appears in /data/app/~~l85PiCK7TDUpT7K6K7sQZA==/edu.paletteeduworkspace.paletteapp-lT2tKVzHxD2_eTga3h3FyA==/base.apk!classes19.dex))

SDK version
6.3.2

To Reproduce
This piece of code is to reproduce.

val uuid = UUID.randomUUID()
                            val channelId = uuid.toString()
                            client.createChannel(
                                channelType = "messaging",
                                channelId = channelId,
                                memberIds = listOf(currentUserId, id),
                                extraData = mutableMapOf(
                                    "networkId" to args.netId,
                                    "programUuid" to args.programId,
                                    "networkName" to SessionManager.getString(requireContext(),"NETWORK_NAME").toString(),
                                    "channel_type" to "normal",
                                    "isArchived" to archivedList(listOf(currentUserId,id))
                                )
                            ).enqueue {channelResult->
                                when(channelResult){
                                    is Result.Failure -> {
                                        Log.d("CreateChannel", channelResult.value.toString())
                                        requireContext().showLongToast(resources.getString(R.string.initiating_the_chat_will_be_available_soon))
                                    }
                                    is Result.Success -> {

                                        Log.d("CreateChannel", channelResult.toString())
                                        findNavController().navigate(
                                            CreateChannelFragmentDirections.actionCreateChannelFragmentToChattingFragment2(
                                                channelResult.value.cid,
                                                args.netId,
                                                args.programId,
                                                0,
                                                args.programName,
                                                channelResult.value.id,
                                                channelResult.value.hasUnread
                                            )
                                        )
                                    }
                                }

                            }

Expected behavior
It should be able to create new channels.

Device:

  • Moto G52
  • 13

Screenshots

@Yatish1910 Yatish1910 added the bug Something isn't working label May 16, 2024
@vijay-anand-dev
Copy link

Hi, is there any update regarding this bug?

@skydoves
Copy link
Member

skydoves commented May 31, 2024

Hi @Yatish1910, @vijay-anand-dev, we're wondering if you still face the same issue after adding the proguard rules below following this guide:

https://github.com/GetStream/stream-chat-android?tab=readme-ov-file#%EF%B8%8F-r8--proguard

## Stream Chat Android Client Proguard Rules

# Classes that are using with QuerySort can't be minified, because QuerySort uses reflection. If the
# name of the fields of the classes being used by QuerySort, change, the sort won't work as expected.
-keep class io.getstream.chat.android.models.** { *; }
-keep class io.getstream.chat.android.client.api2.model.** { *; }

# ExtraDataDto can't be minified because we check for extraData using reflection in
# io.getstream.chat.android.client.parser2.adapters.CustomObjectDtoAdapter. If the name of extraData
# is changed, we will have problem with serialization.
-keep class * extends io.getstream.chat.android.client.api2.model.dto.ExtraDataDto {
    public kotlin.collections.Map extraData;
 }

# Rules necessary for R8 full mode
-keep class io.getstream.chat.android.client.api2.endpoint.** { *; }
-keep class io.getstream.chat.android.client.call.RetrofitCall { *; }
-keep class com.squareup.moshi.JsonReader
-keep class com.squareup.moshi.JsonAdapter
-keep class kotlin.reflect.jvm.internal.* { *; }

# Rules to improve the logs by keeping the names of the classes
-keep class * extends io.getstream.chat.android.client.clientstate.UserState

# Classes that are used by reflection.
-keep class io.getstream.chat.android.client.notifications.ChatPushDelegate { *; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants