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

Android installation with RN 0.67.3 #158

Closed
Spoutnik97 opened this issue Mar 16, 2022 · 3 comments · Fixed by #161
Closed

Android installation with RN 0.67.3 #158

Spoutnik97 opened this issue Mar 16, 2022 · 3 comments · Fixed by #161
Assignees
Labels
bug Something isn't working

Comments

@Spoutnik97
Copy link

Hi,
I am trying to install the DataDog React Native SDK for React Native 0.67.3, but I have an issue for Android.

Remarque: I resolved an issue for iOS thanks to this issue : #41

I have the following error message when I run "react-native run-android":

e: /Users/me/bam/epsor/mobile/node_modules/@datadog/mobile-react-native/android/src/main/java/com/datadog/reactnative/DdTrace.kt: (36, 17): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/me/.gradle/caches/transforms-3/2cb76cdf5bc583a7cdc4100935699356/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
e: /Users/me/bam/epsor/mobile/node_modules/@datadog/mobile-react-native/android/src/main/java/com/datadog/reactnative/DdTrace.kt: (47, 9): Class 'com.datadog.android.bridge.DdTrace' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/me/.gradle/caches/transforms-3/93d0fb38abbe5cfcf24d5a23f1062fbd/transformed/jetified-dd-bridge-android-0.5.3-api.jar!/com/datadog/android/bridge/DdTrace.class
e: /Users/me/bam/epsor/mobile/node_modules/@datadog/mobile-react-native/android/src/main/java/com/datadog/reactnative/DdTrace.kt: (47, 24): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/me/.gradle/caches/transforms-3/2cb76cdf5bc583a7cdc4100935699356/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
e: /Users/me/bam/epsor/mobile/node_modules/@datadog/mobile-react-native/android/src/main/java/com/datadog/reactnative/DdTrace.kt: (48, 17): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/me/.gradle/caches/transforms-3/2cb76cdf5bc583a7cdc4100935699356/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':datadog_mobile-react-native:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s

    at makeError (/Users/me/bam/epsor/mobile/node_modules/execa/index.js:174:9)
    at /Users/me/bam/epsor/mobile/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async runOnAllDevices (/Users/me/bam/epsor/mobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/Users/me/bam/epsor/mobile/node_modules/@react-native-community/cli/build/index.js:192:9)

It seems to be an error with the Kotlin version. Do you know how to fix this?

@Spoutnik97 Spoutnik97 added the bug Something isn't working label Mar 16, 2022
@0xnm
Copy link
Member

0xnm commented Mar 16, 2022

Hello @Spoutnik97! Thanks for opening the issue. Kotlin version 1.5 or above is required to compile our SDK. Can you please try update the version of Kotlin you are using in the app and retry?

@Spoutnik97
Copy link
Author

How do you advise me to do this?

I added this line classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"in the dependencies in my build.gradle

Do you think it is ok?

@0xnm
Copy link
Member

0xnm commented Mar 17, 2022

@Spoutnik97 In your top-level build.gradle you need to specify the kotlinVersion in the buildscript.ext block:

buildscript {
    ext {
        ...
        kotlinVersion = "1.5.31"
    }
    ...
}

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

Successfully merging a pull request may close this issue.

2 participants