Software⏱️ 2 min read📅 2026-06-03

How to Fix: spawnSync ./gradlew EACCES error when running react native project on emulator

EACCES error when running react-native on emulator

Quick Answer: Check the Android SDK and NDK versions, as they may be outdated. Ensure that the Gradle wrapper is correctly configured by running "gradlew --version" to verify its version.

To resolve the EACCES error when running react-native run-android on an emulator, first ensure that your system's user account has the necessary permissions to access the Android Studio installation directory.

🛑 Root Causes of the Error

  • Insufficient permissions to access the Android Studio installation directory.

🛠️ Step-by-Step Verified Fixes

Method 1: Granting System Permissions

  1. Step 1: Open the terminal and run `sudo adduser $USER sudo` to grant your user account additional permissions.

Method 2: Running Gradle with Elevated Permissions

  1. Step 1: Navigate to the directory containing your project's `gradlew` file and run `sudo ./gradlew` instead of `./gradlew`. Alternatively, you can set up your IDE to use an elevated user account.

🎯 Final Words

By following these steps and granting the necessary permissions, you should be able to resolve the EACCES error when running react-native run-android on an emulator.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions