I'm new in React Native. I wanted to run a project with the command:
npx react-native run-android
In summary this error appears:
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for detailsjava.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7* What went wrong:Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
I read about the problem and I think that the problem is the gradle version. In the build.gradle
I have:
buildscript { ext { buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 } repositories { google() jcenter() } dependencies { classpath("com.android.tools.build:gradle:3.5.2") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}
And my JDK version is 14.0.1. How can I solve this problem?