I have did my React-native setup following instructions from https://reactnative.dev/docs/environment-setup
Project has been created successfully.
Android phone also connected using USB but when I try to install App on phone using command-
npx react-native run-android
Following error occured and BUILD FAILED
what went wrong
Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
Error:
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
I'm using Powershell to perform commands.