【问题解决】Error: spawnSync ./gradlew EACCES
MacOs
react-native run-android
出现了以下报错
Make sure you have the Android development environment
Error: spawnSync ./gradlew EACCES
具体:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1016 file(s) to forward-jetify. Using 6 workers...
info JS server already running.
info Installing the app...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: spawnSync ./gradlew EACCESat Object.spawnSync (internal/child_process.js:1041:20)at spawnSync (child_process.js:607:24)at execFileSync (child_process.js:634:15)at runOnAllDevices (/Users/momo/Documents/PR/react-native-apps/demo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)at buildAndRun (/Users/momo/Documents/PR/react-native-apps/demo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:179:41)at /Users/momo/Documents/PR/react-native-apps/demo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:133:12at processTicksAndRejections (internal/process/task_queues.js:93:5)at async Command.handleAction (/Users/momo/Documents/PR/react-native-apps/demo/node_modules/@react-native-community/cli/build/index.js:182:9)
解决办法:
在项目目录下使用以下指令:
chmod 755 android/gradlew
the chmod command sets the permissions of files or directories.
https://www.computerhope.com/unix/uchmod.htm
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
