react-native-screens:compileDebugKotlin FAILED

Viewed 2372

I am trying to use React Navigation in my RN project, but when I install react-native-screens, which is a required package for it to work, I cannot build the project again.

The error I get is the following:

Task :react-native-screens:compileDebugKotlin FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

I have tried a few things I saw other people do, but nothing has worked so far.

Can you help me? Thanks

3 Answers

If you facing this after adding @react-navigation/native@6.0.10 library to a project with react-native @0.69.0 just upgrade react-native-screens@3.14.0 this specific version

I changed my kotlin version to kotlinVersion = "1.5.31" in android/build.gradle

Update android/build.gradle as follows:

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

Note : If this error comes back, Uninstall app from emulator and build again or Delete this emulator and create new one and try.

enter image description here

Related