react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

Android: Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin

Open gen1lee opened this issue 3 years ago • 1 comments

🐛 Bug Report

Android build fails after installing and configuring react-native-navigaiton.

Have you read the Contributing Guidelines on issues?

Yes.

To Reproduce

  1. Clean initial RN project with some native libs installed.
  2. Add react-native-navigation
  3. npx rnn-link
  4. react-native run-android

Expected behavior

Should build and run.

Actual Behavior

Fails with error

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.2. The class is loaded from .../transformed/jetified-kotlin-stdlib-1.6.10.jar!/kotlin/Unit.class5.

Your Environment

  • React Native Navigation version: 7.28.0
  • React Native version: 0.68.2
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Macbook Air M1, Mac 12.4

Are you willing to resolve this issue by submitting a Pull Request?

  • ✖️   No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

gen1lee avatar Jun 13 '22 11:06 gen1lee

Helped changing auto-generated by npx rnn-link lines in android/build.gradle:

- RNNKotlinVersion = "1.4.2"
+ RNNKotlinVersion = "1.6.10"

...

- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.2"
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"

gen1lee avatar Jun 13 '22 12:06 gen1lee

@gen1lee thank you so much!

reyn-nova avatar Jan 18 '23 06:01 reyn-nova