crisp-im / crisp-sdk-android

:package: Crisp Android SDK, add a chat in any Android app and communicate with your users.
https://docs.crisp.chat/guides/chatbox-sdks/android-sdk/
Other
55 stars 17 forks source link

Duplicate Class Found #152

Closed itssubhamroy23 closed 1 year ago

itssubhamroy23 commented 1 year ago

Hi, Getting the error, kindly help resolve this.

Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0) Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0)

image

Doc1faux commented 1 year ago

Hi @itssubhamroy23,

This is not a Crisp-SDK-Android related issue. However, I already encountered this dependency duplicate error while developing the Crisp Android app. It is due to the usage of androidx.preference:preference dependency after android.preference package deprecation. I already reported the issue on Google Issue Tracker but it will not be fixed...

The only fix is to exclude the problematic module from the androidx.preference:preference dependency as follow:

implementation('androidx.preference:preference:1.2.0') {
    exclude group: 'androidx.lifecycle', module:'lifecycle-viewmodel'
    exclude group: 'androidx.lifecycle', module:'lifecycle-viewmodel-ktx'
}
itssubhamroy23 commented 1 year ago

Hi, Thanks for your reply. But actually I am unav=ble to fix the issue even after putting the implementation rules in the build.gradle file. Could you please help me fix this issue?

On Thu, Mar 2, 2023 at 9:57 PM Sébastien Vitard @.***> wrote:

Closed #152 https://github.com/crisp-im/crisp-sdk-android/issues/152 as completed.

— Reply to this email directly, view it on GitHub https://github.com/crisp-im/crisp-sdk-android/issues/152#event-8651353598, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT6BKZYYGR53RMMXTB63VE3W2DDABANCNFSM6AAAAAAVMFS66I . You are receiving this because you were mentioned.Message ID: @.***>

Doc1faux commented 1 year ago

Unfortunately, I cannot help much more on this :/ The only advice I could give you is to find which of your dependencies use the outdated androidx.lifecycle:lifecycle-viewmodel(-ktx):2.3.1 and add the exclude rules to them as I did when I had to switch between outdated android.preference package and the new dependency provided by Google androidx.preference:preference:1.2.0. I know it's a pain in the ass to figure it out :/

itssubhamroy23 commented 1 year ago

Thanks, Finally able to resolve that with just one line of code

implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'

On Fri, Mar 3, 2023 at 3:57 PM Sébastien Vitard @.***> wrote:

Unfortunately, I cannot help much more on this :/ The only advice I could give you is to find which of your dependencies use the outdated androidx.lifecycle:lifecycle-viewmodel(-ktx):2.3.1 and add the exclude rules to them as I did when I had to switch between outdated android.preference package and the new dependency provided by Google androidx.preference:preference:1.2.0. I know it's a pain in the ass to figure it out :/

— Reply to this email directly, view it on GitHub https://github.com/crisp-im/crisp-sdk-android/issues/152#issuecomment-1453305846, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT6BKZ3TEYJTADKIJ2XLGDLW2HBSJANCNFSM6AAAAAAVMFS66I . You are receiving this because you were mentioned.Message ID: @.***>

itssubhamroy23 commented 1 year ago

By the way, I have few more issues with the app if you're the developer of the same.

  1. It takes a lot of time to deliver the message
  2. I am using a high speed internet, still it's constantly showing "Failed to send. retry?" It's really irritating sometimes.

Please fix those issues

On Sat, Mar 4, 2023 at 12:40 AM Subham Roy @.***> wrote:

Thanks, Finally able to resolve that with just one line of code

implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'

On Fri, Mar 3, 2023 at 3:57 PM Sébastien Vitard @.***> wrote:

Unfortunately, I cannot help much more on this :/ The only advice I could give you is to find which of your dependencies use the outdated androidx.lifecycle:lifecycle-viewmodel(-ktx):2.3.1 and add the exclude rules to them as I did when I had to switch between outdated android.preference package and the new dependency provided by Google androidx.preference:preference:1.2.0. I know it's a pain in the ass to figure it out :/

— Reply to this email directly, view it on GitHub https://github.com/crisp-im/crisp-sdk-android/issues/152#issuecomment-1453305846, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT6BKZ3TEYJTADKIJ2XLGDLW2HBSJANCNFSM6AAAAAAVMFS66I . You are receiving this because you were mentioned.Message ID: @.***>