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.
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?

./gradlew --verbose? Did you try github.com/Sparticuz/chromium/issues/63#issuecomment-1937567953 ?