0

I am trying to run my React Native Android project on macOS using:

npx react-native run-android

But the build fails with this error: error Failed to install the app. Command failed with Unknown system error -8: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 spawn Unknown system error -8. info Run CLI with --verbose flag for more details.

enter image description here

The strange part is:

  • The project builds fine on Windows
  • It also builds successfully inside Android Studio on macOS
  • The error only happens when running npx react-native run-android

What I already checked

  • SDK paths are correct
  • Permissions are correct
  • No quarantine flags on gradlew or node_modules
  • I recently upgraded the project

My environment

React Native: 0.77.3
Node: 20.15.1
OpenJDK: 17.0.14 (LTS)
macOS

Question

What can cause Unknown system error -8 when spawning ./gradlew in React Native CLI, and how can I fix this? Why does Android Studio build successfully, but the CLI fails?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.