Reputation: 21
React native 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
BU�LD FAILED in 663ms
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)
how can i solve this problem? please help
Upvotes: 1
Views: 7791
Reputation: 322
This issue is because of the gradle version. You can fix it by:
android
directory and find build.gradle
filebuild.gradle
filedistributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
, using the gradle-6.3react-native run-android
Upvotes: 0