1
votes

FAILURE: Build failed with an exception.

BUILD FAILED in 8s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

BUILD FAILED in 8s

at checkExecSyncError (child_process.js:616:11)
at execFileSync (child_process.js:634:15)
at runOnAllDevices (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at async Command.handleAction (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli\build\cliEntry.js:160:7)

PS C:\Users\k7aled\Desktop\reactnative\test2> npx react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 928 file(s) to forward-jetify. Using 4 workers... info Starting JS server... info Installing the app...

FAILURE: Build failed with an exception.

BUILD FAILED in 10s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

BUILD FAILED in 10s

at checkExecSyncError (child_process.js:616:11)
at execFileSync (child_process.js:634:15)
at runOnAllDevices (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at async Command.handleAction (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli\build\cliEntry.js:160:7)

PS C:\Users\k7aled\Desktop\reactnative\test2>

1

1 Answers

0
votes

first add this two line to your android/gradle.properties :

android.useAndroidX=true
android.enableJetifier=true

then run this two command line in your project root with terminal(cmd):

npm i jetifier
npx jetify