Closed rethinavelsmitch closed 1 year ago
Hey there @rethinavelsmitch !
Could you verify that there is no mismatch between the moshi versions in your app and our SDK?
And could you share your Stream SDK version so that we can look into this a bit more?
Hey @filbabic!
I am not using Moshi in my app. It is only used in Getstream Library module. Am using GsonConverter in my app. Is that a problem?
Get Stream SDK Version is : [5.11.8] Moshi Converter Version is : [internal const val MOSHI = "1.14.0"]
@rethinavelsmitch
Thank you for the input!
Looking at the logs again and what you provided, it seems that the thing that's failing is the mismatch between the generated code.
Now this can be due to many things, different versions in the project setup, the way that generation is done or something similar.
Would you be able to provide a public repo with the absolute minimum setup required for this to be replicable? Maybe we can figure out if it's a kotlin version mismatch, kapt/KSP or something like that, that's generating incorrect (or mismatched) code.
@filbabic
Thanks for the response.
I really can't disclose the source code. The app works fine when I set minifyenabled
to false
. I tried to keep the classes by writing the following proguard rules.
# Keep ToJson/FromJson-annotated methods -keepclassmembers class * { @com.squareup.moshi.FromJson <methods>; @com.squareup.moshi.ToJson <methods>; }
Why code obfuscation is happening if I still has the above lines in proguard rules.pro? Is that possible to keep all the classes in release build?
I will create a sample application and share it with you asap.
Closing the issue until further feedback as some time has elapsed since the last response.
Describe the bug GetStream is one of the best chat SDK. The app is working very fine when I run the debug build. But unfortunately, I am getting error while taking the release build. I had added the screenshots for reference.
Unexpected signature for public final io.getstream.chat.android.client.api2.model.dto.DownstreamMessageDto io.getstream.chat.android.client.parser2.adapters.DownstreamMessageDtoAdapter.fromJson(com.squareup.moshi.JsonReader,com.squareup.moshi.JsonAdapter,com.squareup.moshi.JsonAdapter).
To Reproduce Steps to reproduce the behavior:
Expected behavior It should create a connection
Device:
Android version: [12]
This code works perfectly fine in Debug build.
`import io.getstream.chat.android.Dependencies
apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'androidx.navigation.safeargs.kotlin' apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' //apply plugin: 'com.huawei.agconnect' apply plugin: 'shot' apply plugin: 'kotlin-parcelize' apply plugin: 'com.google.devtools.ksp'
android { compileSdk 33 defaultConfig { buildConfigField 'String', 'STREAM_CHAT_VERSION', "\"$version\"" testApplicationId "io.getstream.chat.ui.sample" minSdk 23 targetSdk 33 }
} `
This is my build.gradle file. I converted the sample app into a module and added into my app. Since it is a module and publicly available, I set minifyenabled property to false.