title: React Native Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
body: <p>React native error Failed to install the app. Make sure you have the Android development environment set up: <a href="https://reactnative.dev/docs/environment-setup" rel="nofollow noreferrer">https://reactnative.dev/docs/environment-setup</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="nofollow noreferrer">https://help.gradle.org</a></p></li>
  </ul>
  
  <p>BU�LD FAILED in 663ms</p>
  
  <pre><code>at makeError (C:\dea\node_modules\execa\index.js:174:9)
  at C:\dea\node_modules\execa\index.js:278:16
  at processTicksAndRejections (internal/process/task_queues.js:97:5)
  at async runOnAllDevices (C:\dea\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
  at async Command.handleAction (C:\dea\node_modules\@react-native-community\cli\build\index.js:186:9)
  </code></pre>
  
  <p>how can i solve this problem? please help</p>