DataDog / dd-sdk-reactnative

Datadog SDK for ReactNative
Apache License 2.0
115 stars 41 forks source link

Error after add @datadog/mobile-react-native #713

Open AlexLFundbox opened 1 month ago

AlexLFundbox commented 1 month ago

Describe the issue

I'm trying to add "@datadog/mobile-react-native": "^2.4.3" and "@datadog/mobile-react-navigation": "^2.4.3" but getting error on android build `* What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class androidx.work.OneTimeWorkRequestKt found in modules work-runtime-2.8.1.aar -> work-runtime-2.8.1-runtime (androidx.work:work-runtime:2.8.1) and work-runtime-ktx-2.7.1.aar -> work-runtime-ktx-2.7.1-runtime (androidx.work:work-runtime-ktx:2.7.1) Duplicate class androidx.work.PeriodicWorkRequestKt found in modules work-runtime-2.8.1.aar -> work-runtime-2.8.1-runtime (androidx.work:work-runtime:2.8.1) and work-runtime-ktx-2.7.1.aar -> work-runtime-ktx-2.7.1-runtime (androidx.work:work-runtime-ktx:2.7.1)`

 Attaching my dependency tree

output.txt

According to dependency tree, I have 2 libraries (react-native-plaid-link-sdk and react-native-idfa) that use different version of work-runtime I'm also using the last versions of those libraries androidx.work:work-runtime:2.7.1 -> 2.8.1

Is there any idea how can i resolve this issue?

Reproduction steps

I believe that reproduction steps are: to install react-native-plaid-link-sdk and react-native-idfa And then install @datadog/mobile-react-native and @datadog/mobile-react-navigation and try to build android

SDK logs

No response

Device Information

No response

SDK version

2.4.3

Integration Methods

Yarn

React Native Version

0.74.3

Package.json Contents

No response

iOS Setup

No response

Android Setup

No response

Other relevant information

No response

AlexLFundbox commented 1 month ago

I've added this in app.build.gradle inside dependencies

configurations.all {
    resolutionStrategy {
        force 'androidx.work:work-runtime:2.8.1'
        force 'androidx.work:work-runtime-ktx:2.8.1'
    }
}

but now I'm seeing this issue

> Task :datadog_mobile-react-native:runKtlintCheckOverMainSourceSet FAILED

> Task :app:minifyReleaseWithR8
WARNING: R8: Class com.facebook.imagepipeline.image.CloseableAnimatedImage extends com.facebook.imagepipeline.image.CloseableImage which is an interface

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':datadog_mobile-react-native:runKtlintCheckOverMainSourceSet'.
> A failure occurred while executing org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction
   > KtLint failed to parse file: /Users/alex.lvovsky/fundbox/mobileNative/node_modules/@datadog/mobile-react-native/android/src/oldarch/kotlin/com/datadog/reactnative/DdLogs.kt
marco-saia-datadog commented 1 month ago

Hi @AlexLFundbox, thank you for reaching out! I'll investigate this soon and get back to you. Do you know which dependency is causing the conflict? Is it react-native-plaid-link-sdk or react-native-idfa?

AlexLFundbox commented 1 month ago

@marco-saia-datadog , thanks for your response Actually it's coming from both of them