square / react-native-square-reader-sdk

React Native Plugin for Square Reader SDK
Apache License 2.0
115 stars 34 forks source link

[Android] Usable with work-runtime-2.8.0? #224

Closed fobos531 closed 11 months ago

fobos531 commented 1 year ago

Describe your question

Hello, by inspecting the dependencies of my app, I have determined that Square's Android Reader SDK uses work-runtime 2.7.0. However, I am using another dependencies that depend on work-runtime 2.8.0. Because of that, I'm getting duplicate class conflicts:

  > Duplicate class androidx.work.OneTimeWorkRequestKt found in modules work-runtime-2.8.0-runtime (androidx.work:work-runtime:2.8.0) and work-runtime-ktx-2.7.0-runtime (androidx.work:work-runtime-ktx:2.7.0)

Is it safe to run the Square SDK with work-runtime-2.8.0? What solutions do you offer in this situation?

bwisem commented 11 months ago

As of right now Square's Reader SDK hasn't updated to use work-runtime 2.8.0, so as a workaround you can forcing the gradle dependency to use either 2.7.0 or 2.8.0.

configurations.all {
  resolutionStrategy.eachDependency { details ->
    if (details.requested.group == 'androidx.work.work-runtime') {
      details.useVersion "2.7.0"
    }
  }
}