1

When I build my android app, I get this error message:

Task :react-native-screens:compileReleaseKotlin FAILED e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors e: /Users/vagrant/.gradle/caches/transforms-3/1811d0365a09e856e56e835cbefa53ec/transformed/jetified-kotlin-stdlib-jdk7-1.6.10.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: 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.

How can I fix this?

I tried to extend the version from 1.4.0 to 1.6.0 but I receive the following error:

> Task :app:mergeReleaseNativeLibs FAILED
Execution optimizations have been disabled for task ':app:mergeReleaseNativeLibs' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/Users/aalarcony/work/diampark/digipark_react_app/android/app/build/intermediates/merged_jni_libs/release/out'. Reason: Task ':app:mergeReleaseNativeLibs' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. Th
halfer
  • 19,824
  • 17
  • 99
  • 186
  • Just wanted to chime in that I am also seeing this error as of Nov 4, seemingly all of a sudden. I'm trying to find a solution so will post here if I do. – gabriellend Nov 07 '22 at 19:39

1 Answers1

3

So I was able to get my project to build by following these instructions on the react-native-screens GitHub. Basically I just added this to my build.gradle file:

buildscript {
ext {
    kotlinVersion = "1.6.0"
}
}

Still wish I knew why it has been working for a months and all of a sudden it broke!

halfer
  • 19,824
  • 17
  • 99
  • 186
gabriellend
  • 265
  • 2
  • 12
  • Is it worth raising a GitHub issue about this on the relevant GitHub repo? I wonder if this is something that might be good to bring to the authors' attention. – halfer Nov 07 '22 at 22:21
  • 1
    @halfer I don't think so, it seems like they already know. This issue was similar and closed: https://github.com/software-mansion/react-native-screens/issues/1449. Seems like more than just RN 0.69 was affected and some people solved it by upgrading to a newer version of `react-native-screens`. The instructions I referenced are from their README so they know that sometimes a different Kotlin version might be needed. – gabriellend Nov 08 '22 at 00:14