Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
684 views
in Technique[技术] by (71.8m points)

gradle - spawnSync ./gradlew EACCES error when running react native project on emulator udara

I am trying to use react-native run-android to install my react-native application on an android studio emulator. I have checked with abd-devices that the emulator is available, and I have ran npm-install.

I am using Ubuntu 18.04 with the latest version of android studio, and the latest Pixel 2 XL API 28.

I get the following error:

spawnSync ./gradlew EACCES

Error: spawnSync ./gradlew EACCES
    at Object.spawnSync (internal/child_process.js:998:20)
    at spawnSync (child_process.js:622:24)
    at Object.execFileSync (child_process.js:650:13)
    at runOnAllDevices (/home/user/react/front-end/project/node_modules    /react-native/local-cli/runAndroid/runAndroid.js:299:19)
    at buildAndRun (/home/user/react/front-end/project/node_modules/react-native/local-cli/runAndroid/runAndroid.js:135:12)
    at isPackagerRunning.then.result (/home/user/react/front-end/project/node_modules/react-native/local-cli/runAndroid/runAndroid.js:65:12)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)

I have tried restarting my PC and the emulator several times. Any ideas?

UPDATE: I reinstalled JDK, npm, react-native-cli and android studio. It still gives me the exact same error. Please help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I fixed this problem with:

chmod 755 android/gradlew 

the chmod command sets the permissions of files or directories. https://www.computerhope.com/unix/uchmod.htm


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...