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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…