title: How to solve (Could not initialize class org.codehaus.groovy.reflection.ReflectionCache) issue in react native
body: <p>$ npx react-native run-android
  info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
  Jetifier found 864 file(s) to forward-jetify. Using 4 workers...
  info Starting JS server...
  info Launching emulator...
  error Failed to launch the emulator. Reason: Could not start an emulator within 30 seconds.
  warn Please launch an emulator manually or connect a device. Otherwise, the app may fail to launch.
  info Installing the app...</p>
  
  <p>FAILURE: Build failed with an exception.</p>
  
  <ul>
  <li><p>What went wrong:
  Could not initialize class org.codehaus.groovy.runtime.InvokerHelper</p></li>
  <li><p>Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.</p></li>
  <li><p>Get more help at <a href="https://help.gradle.org" rel="noreferrer">https://help.gradle.org</a></p></li>
  </ul>
  
  <p>BUILD FAILED in 1m 23s</p>
  
  <p>error Failed to install the app. Make sure you have the Android development environment set up: <a href="https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment" rel="noreferrer">https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment</a>. Run CLI with --verbose flag for more details.
  Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081</p>
  
  <p>FAILURE: Build failed with an exception.</p>
  
  <ul>
  <li><p>What went wrong:
  Could not initialize class org.codehaus.groovy.runtime.InvokerHelper</p></li>
  <li><p>Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.</p></li>
  <li><p>Get more help at <a href="https://help.gradle.org" rel="noreferrer">https://help.gradle.org</a></p></li>
  </ul>
  
  <p>BUILD FAILED in 1m 23s</p>
  
  <pre><code>at checkExecSyncError (child_process.js:629:11)
  at execFileSync (child_process.js:647:13)
  at runOnAllDevices (E:\work\react-native\AwesomeProject1\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
  </code></pre>