Open raminafandi opened 1 year ago
I believe you need to define kotlin_version
within your android/build.gradle
. For example -
buildscript {
ext {
...
kotlin_version = '1.5.10'
}
You need to follow this to complete the setup for Android: https://github.com/teslamotors/react-native-camera-kit/blob/master/docs/kotlin.md.
My setup is using React Native 0.71 which comes with Kotlin enabled.
To resolve the error message reported, I added the following in android/build.gradle
kotlinVersion = '1.7.10' // camelCase, this is the existing variable name
kotlin_version = '1.7.10' // react-native-camera-kit looks for this snake_case variable name
The issue with the marked, solution is that it wouldn't work for expo. Does any have a solution that would be expo compatible too?
update your android/build.gradle
file like this
ext {
...
kotlinVersion = "1.9.24"
kotlin_version = "1.9.24"// for react-native-camera-kit`
...
}
But shouldn't we leave the android/build.gradle untouched in order for expo to work properly?
Expo should handle builds, so I want to avoid adding custom code in there.
Locally, that works. To build remotely, using expo, is where it stops to work.
My setup is using React Native 0.71 which comes with Kotlin enabled.
To resolve the error message reported, I added the following in
android/build.gradle
kotlinVersion = '1.7.10' // camelCase, this is the existing variable name kotlin_version = '1.7.10' // react-native-camera-kit looks for this snake_case variable name
This worked for me - React Native 0.73.9 (not using Expo). Or even better, reference with the original variable:
// android/build.gradle
buildscript {
ext {
kotlinVersion = "x.x.x"
kotlin_version = kotlinVersion // For react-native-camera-kit
}
}
When I am building an android apk, build fails with this exception:
FAILURE: Build failed with an exception.
Version: "react-native": "0.70.6",