react-native-navigation
react-native-navigation copied to clipboard
Android: Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin
🐛 Bug Report
Android build fails after installing and configuring react-native-navigaiton.
Have you read the Contributing Guidelines on issues?
Yes.
To Reproduce
- Clean initial RN project with some native libs installed.
- Add
react-native-navigation -
npx rnn-link -
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.
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 thank you so much!