TheWidlarzGroup / react-native-video

A <Video /> component for react-native
http://thewidlarzgroup.github.io/react-native-video/
MIT License
7.12k stars 2.88k forks source link

[BUG]: Android Kotlin version mismatch #4009

Closed Mihai-github closed 1 month ago

Mihai-github commented 1 month ago

Version

^6.4.1

What platforms are you having the problem on?

Android

System Version

React Native

On what device are you experiencing the issue?

Real device, Simulator

Architecture

Old architecture

What happened?

Task :react-native-video: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/builder/.gradle/caches/transforms-3/113c75e423850f09a3a96afbb04140d6/transformed/jetified-kotlin-stdlib-1.9.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.9.0, expected version is 1.7.1. e: /Users/builder/.gradle/caches/transforms-3/113c75e423850f09a3a96afbb04140d6/transformed/jetified-kotlin-stdlib-1.9.10.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. e: /Users/builder/.gradle/caches/transforms-3/113c75e423850f09a3a96afbb04140d6/transformed/jetified-kotlin-stdlib-1.9.10.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. e: /Users/builder/.gradle/caches/transforms-3/46c2d7941a38979bf7d7f7ec3d090515/transformed/jetified-kotlin-stdlib-common-1.9.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. e: /Users/builder/.gradle/caches/transforms-3/87bfc0762e08f5de7559bcbc54306d9d/transformed/jetified-okio-jvm-3.6.0.jar!/META-INF/okio.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. e: /Users/builder/clone/node_modules/react-native-video/android/src/main/java/com/brentvatne/common/api/BufferConfig.kt: (40, 14): Class 'kotlin.jvm.JvmStatic' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from /Users/builder/.gradle/caches/transforms-3/113c75e423850f09a3a96afbb04140d6/transformed/jetified-kotlin-stdlib-1.9.10.jar!/kotlin/jvm/JvmStatic.class e: /Users/builder/clone/node_modules/react-native-video/android/src/main/java/com/brentvatne/common/api/BufferConfig.kt: (43, 22): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from /Users/builder/.gradle/caches/transforms-3/113c75e423850f09a3a96afbb04140d6/transformed/jetified-kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class e: /Users/builder/clone/node_modules/react-native-video/android/src/main/java/com/brentvatne/common/api/BufferConfig.kt: (44, 22): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from /Users/builder/.gradle/caches/transforms-3/113c75e423850f09a3a96afbb04140d6/transformed/jetified-kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class ... ... ...

Reproduction

Just trying to compile for release the application

KrzysztofMoch commented 1 month ago

you can try

h-dung-95 commented 1 month ago

I have the same problem, is there any way to solve it? Error message: "Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1."

I used to RN 0.72.0

KrzysztofMoch commented 1 month ago

@h-dung-95 try set compileSdkVersion & targetSdkVersion (in build.gradle) to 34 and kotlinVersion to 1.9.0

Sk0057 commented 1 month ago

@KrzysztofMoch

try set compileSdkVersion & targetSdkVersion (in build.gradle) to 34 and kotlinVersion to 1.9.0

After setting these and also adding classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" statement inside dependencies in my build.gradle file, things are working fine for me now in my React Native(version 0.73.4) project btw I am using react-native-video version ^6.3.0 Thanks!