As per the codebase, I observed that the react-native-screens project is using Kotlin
for their development. Whereas in you project, you are implementing your project in pure Java
.
So, to use this library, you would need to add kotlin support in your project. To do so, please add following code snippet in your project level build.gradle
- In
buildscript
's dependencies
block add kotlin classpath:
// Project build.gradle file.
buildscript {
ext.kotlin_version = '1.4.10'
...
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
- Then apply
kotlin-android
plugin to all the required module by adding following in required module's build.gradle
file.
plugins {
...
id 'kotlin-android'
}
You can find the same implementation in the library at react-native-screens build.gradle Line 12 and react-native-screens build.gradle Line 23.
Ref: https://developer.android.com/kotlin/add-kotlin