Reputation: 71
I'm just trying to run a simple and empty react native project in android emulator but I'm getting this error anyone have any ideas?
error:
Error: C:\Users\Onur\Desktop\ReactNative\MemorizingApp\android\gradlew.bat exited with non-zero code: 1 Error: C:\Users\Onur\Desktop\ReactNative\MemorizingApp\android\gradlew.bat exited with non-zero code: 1 at ChildProcess.completionListener (C:\Users\Onur\Desktop\ReactNative\MemorizingApp\node_modules@expo\spawn-async\build\spawnAsync.js:52:23) at Object.onceWrapper (node:events:628:26) at ChildProcess.emit (node:events:513:28) at ChildProcess.cp.emit (C:\Users\Onur\Desktop\ReactNative\MemorizingApp\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1093:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) ... at Object.spawnAsync [as default] (C:\Users\Onur\Desktop\ReactNative\MemorizingApp\node_modules@expo\spawn-async\build\spawnAsync.js:17:21) at spawnGradleAsync (C:\Users\Onur\Desktop\ReactNative\MemorizingApp\node_modules@expo\cli\build\src\start\platforms\android\gradle.js:72:46) at Object.assembleAsync (C:\Users\Onur\Desktop\ReactNative\MemorizingApp\node_modules@expo\cli\build\src\start\platforms\android\gradle.js:52:18) at runAndroidAsync (C:\Users\Onur\Desktop\ReactNative\MemorizingApp\node_modules@expo\cli\build\src\run\android\runAndroidAsync.js:31:24) at processTicksAndRejections (node:internal/process/task_queues:96:5)
Upvotes: 5
Views: 15573
Reputation: 31
in my case, (with Expo) :
I deleted all folder/files in the folder "android" relative to gradle, so the following :
And after I run the usual command
npx expo run:android
and it worked !
Upvotes: 1
Reputation: 141
In my case, I did not have Gradle installed on my machine.
gradle -v
choco install gradle
(there are other ways to install it)gradle --stop
to ensure that no gradle daemon is runningrefreshenv
in itUpvotes: 4