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

Kotlin Gradle Plugin Version Conflicting In React Native 0.69 #1449

Closed
ErHarinderSingh opened this issue May 14, 2022 · 14 comments
Closed

Kotlin Gradle Plugin Version Conflicting In React Native 0.69 #1449

ErHarinderSingh opened this issue May 14, 2022 · 14 comments
Assignees
Labels
Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario

Comments

@ErHarinderSingh
Copy link

Please check it. It's 1.4.10 and failing build. When I manually update it to 1.6.10 it works well. I am using New Arch Fabric from React Native.

This is the error. Please take a look.
Screenshot 2022-05-14 at 12 30 03
This is the manual fix I have set on my local side and it works well

Screenshot 2022-05-14 at 12 31 36

@github-actions
Copy link

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Description, Steps To Reproduce, Reproduction and Platform sections.

@github-actions github-actions bot added the Missing info The user didn't precise the problem enough label May 14, 2022
@github-actions
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snippet of code, a snack or a link to a GitHub repository that reproduces the problem?

@github-actions github-actions bot added the Missing repro This issue need minimum repro scenario label May 14, 2022
@AlirezaHadjar
Copy link

I'm facing this issue too after upgrading RN version to 0.69

@zolbooo
Copy link

zolbooo commented Jun 2, 2022

You can specify Kotlin version to use in android/build.gradle. For example:

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

For more details, see README.md, under Need to use a custom Kotlin version? spoiler.

@monholm
Copy link

monholm commented Jun 9, 2022

Not trying to do a simple +1, but since OP didn't fill out the issue template and also specified using fabcric, I wanted to add a few things:

This happens in a clean react-native@0.69-rc.6 project, doing nothing but installing react-native-screens, e.g. the steps to reproduce are as simple as:

npx react-native init RN069RC6 --version 0.69.0-rc.6
yarn add react-native-screens
yarn start
yarn android

yarn android fails with:

FAILURE: Build failed with an exception.

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

with the log containing a bunch of

Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.

and

Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.

Manually specifying kotlinVersion as suggested above does mitigate the issue, but I have no use for a custom kotlin version (besides getting react-native-screens to compile). There seems to be a conflict with the basic react-native template :)

@nibblesnbits
Copy link

+1

With RN 0.69.0 officially released and this being a dependency for @react-navigation/native, this should hopefully bump it up on the priority list.

@kkafar
Copy link
Member

kkafar commented Jun 30, 2022

Hi @ErHarinderSingh!
3.14 has just been released, with #1484 which should resolve the issue. Could you try it out and let us know whether the problem is indeed resolved?

@kkafar kkafar self-assigned this Jun 30, 2022
@monholm
Copy link

monholm commented Jul 1, 2022

@kkafar we have react-native-screens@3.14.0 running on react-native@0.69.1 without any workarounds 👍

@Victorvikson1996
Copy link

Configure project :react-native-reanimated
AAR for react-native-reanimated has been found
/Users/chukwuebuka/Native/Damini/PreBetaMobile/node_modules/react-native-reanimated/android/react-native-reanimated-67-jsc.aar

@kkafar
Copy link
Member

kkafar commented Jul 4, 2022

Feel free to reopen in case the problem still occurs.

@kkafar kkafar closed this as completed Jul 4, 2022
@ErHarinderSingh
Copy link
Author

ErHarinderSingh commented Jul 5, 2022

It is working fine now @kkafar. Thanks ❤️

@lakshan28
Copy link

This work for me

Update android/build.gradle as follows:

       `{ 
         buildscript {
           ext {
                    ...
                    kotlinVersion = "1.5.31"
              }
           dependencies {
                   classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
               }
              }
            }`

@heart2friend
Copy link

Suddenly I started getting this issue for "react-native": "0.68.2" & "react-native-screens": "^3.13.1" updating react-native-screens to 3.14.1 resolved my issue.

@Mihai-github
Copy link

Hey guys, did anyone have an instance when specifing everything for a particular kotlin version to be set and did nothing???
For me, I'm trying for already a few days to set the kotlin version a library wants, and for an unknown reason, the error keeps being the same, Jesus...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario
Projects
None yet
Development

No branches or pull requests

10 participants