title: react-native run-android not working. Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
body: <p>I am trying to run react-native with the CLI method.
  I also got the react-native-vector-icons and linked it to react native as following this tutorial from traversy media - <a href="https://www.youtube.com/watch?v=Hf4MJH0jDb4&amp;t=933s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=Hf4MJH0jDb4&amp;t=933s</a>.
  I had android studio installed and also Gradle all updated to the latest version.</p>
  
  <pre><code>Java Version
  java 14.0.1 2020-04-14
  Java(TM) SE Runtime Environment (build 14.0.1+7)
  Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)
  </code></pre>
  
  <p>What cmd says the problem is.</p>
  
  <pre><code>* What went wrong:
  Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
  
  * 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.
  
  * Get more help at https://help.gradle.org
  </code></pre>
  
  <p>This is what I am getting in my cmd. What is the problem? 
  This is my entire console when I run the command to start with the above included.</p>
  
  <pre><code>C:\Users\Devesh\ShoppingList&gt;react-native run-android
  info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
  Jetifier found 967 file(s) to forward-jetify. Using 4 workers...
  info Starting JS server...
  info Installing the app...
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
  
  * 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.
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 864ms
  
  error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
  Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
  
  * 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.
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 864ms
  
      at makeError (C:\Users\Devesh\ShoppingList\node_modules\execa\index.js:174:9)
      at C:\Users\Devesh\ShoppingList\node_modules\execa\index.js:278:16
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
      at async runOnAllDevices (C:\Users\Devesh\ShoppingList\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
      at async Command.handleAction (C:\Users\Devesh\ShoppingList\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)
  
  </code></pre>
  
  <p>The android emulator launches but does not load the react app or anything, just plain emulator and the react CLI in another window. Did someone else run into this problem too? Do you know how to fix this?</p>