2

I am facing issues while using the react-native-vision-camera package for a small camera app. I encountered an error while building the app on Android which says "The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher.The following dependencies do not satisfy the required version: project ':react-native-vision-camera' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30 and its failing my built on android."

I tried adding "kotlinVersion = "1.7.0" (under buildToolsVersion) to the android/build.gradle file but it gave me another error "Error: EPERM: operation not permitted." Running the commands as an administrator also did not work. I am using a Windows 10 machine with the latest version of Node.js and React Native.

Has anyone successfully set up the react-native-vision-camera package? I have followed the documentation but still facing these issues. It would be great if anyone could help me fix these errors and provide proper setup instructions.

4 Answers 4

12

There is no need to change anything in node_modules (this is not very good). It's simple enough in your android/build.gradle add

kotlinVersion = '1.6.20' 

inside buildscript->ext

Sign up to request clarification or add additional context in comments.

Comments

2

Specify kotlin version inside android/build.gradle file

 kotlinVersion = "1.7.0" 

Comments

0

I went to this folders from the main app folder "node_modules/react-native-vision-camera/android/build.gradle"

def kotlin_version = '1.6.20'

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
-1

To solve this issue, you can try upgrading the Kotlin Gradle plugin version in the react-native-vision-camera project to version 1.6.20 or higher, which is supported by the Android Gradle plugin version you are using.

Go to node_modules/react-native-vision-camera/android/build.gradle

 dependencies { .... - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20" .... } 

inside dependencies

remove classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

add classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.