ubiroliv
ubiroliv

Reputation: 21

React Native Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

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.

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

Answers (1)

Jaden
Jaden

Reputation: 322

This issue is because of the gradle version. You can fix it by:

  • First, go to android directory and find build.gradle file
  • Open build.gradle file
  • Change distributionUrl=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.3
  • cmd run react-native run-android

Upvotes: 0

Related Questions