How to change gradle kotlin version

I am trying to setup a react-native development environment in visual studio code and android studio using react-native CLI. I get many errors Class _____was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.Android studio has kotlin 1.8.0. I have tried adding kotlinVersion = “1.8.0” to gradle.build, changed the gradle version to 8.1.1 using “distributionUrl=https://services.gradle.org/distributions/gradle-8.1.1-all.zip” in graddle-wrapper.properies, and reinstalling android studio and JDK, but the error still persists. Does anyone know how to properly change the gradle kotlin version or find some other workaround for react-native development?