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:UsersOnurDesktopReactNativeMemorizingAppandroidgradlew.bat exited with non-zero code: 1
Error: C:UsersOnurDesktopReactNativeMemorizingAppandroidgradlew.bat exited with non-zero code: 1
at ChildProcess.completionListener (C:UsersOnurDesktopReactNativeMemorizingAppnode_modules@expospawn-asyncbuildspawnAsync.js:52:23)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.cp.emit (C:UsersOnurDesktopReactNativeMemorizingAppnode_modulescross-spawnlibenoent.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:UsersOnurDesktopReactNativeMemorizingAppnode_modules@expospawn-asyncbuildspawnAsync.js:17:21)
at spawnGradleAsync (C:UsersOnurDesktopReactNativeMemorizingAppnode_modules@expoclibuildsrcstartplatformsandroidgradle.js:72:46)
at Object.assembleAsync (C:UsersOnurDesktopReactNativeMemorizingAppnode_modules@expoclibuildsrcstartplatformsandroidgradle.js:52:18)
at runAndroidAsync (C:UsersOnurDesktopReactNativeMemorizingAppnode_modules@expoclibuildsrcrunandroidrunAndroidAsync.js:31:24)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2
Answers
ANDROID_SDK_ROOT
variable in your system variables.Solved the issue for me
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 it