react-native-crisp-chat-sdk
react-native-crisp-chat-sdk copied to clipboard
Android build: "incompatible version of Kotlin. The binary version of its metadata is x.x.x, expected version is y.y.y.
I installed the latest Crisp SDK, and it works fine for iOS. On Android I am getting the following error.
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.
> Task :react-native-crisp-chat-sdk: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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.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/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (23, 15): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (28, 9): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (29, 17): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (39, 15): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (54, 15): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (59, 15): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (64, 15): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (69, 15): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (76, 7): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (89, 13): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (98, 15): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (104, 63): Unresolved reference: java
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkModule.kt: (106, 17): 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/user/.gradle/caches/transforms-3/7d87ab3537d107743bd804cc4168d605/transformed/jetified-kotlin-stdlib-1.9.24.jar!/kotlin/Unit.class
e: /Users/user/Documents/novelship-projects/novelship-app/node_modules/react-native-crisp-chat-sdk/android/src/main/java/com/reactnativecrispchatsdk/CrispChatSdkPackage.kt: (17, 14): Unresolved reference: emptyList
I was able to make this error go away and build the app by changing kotlinVersion in android/build.gradle to 1.7.20.
But I am not sure if this is the right way. Is there any better way to handle this?
My build config
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 24
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
supportLibVersion = "29.0.0"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:7.4.2')
classpath('com.google.gms:google-services:4.3.10')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}