expo / create-react-native-app

Create React Native apps that run on iOS, Android, and web
BSD 3-Clause "New" or "Revised" License
13.26k stars 1.35k forks source link

Unable to build Android using "expo run:android" #908

Open Kalph13 opened 2 years ago

Kalph13 commented 2 years ago

All recent projects created by "create-react-native-app" are not working with the command "expo run:android".

Old projects that I created before (just 1-2 weeks ago) work well with the same command.

Is there any recent updates or changes related to this?

Error messages are attached below. This project is a new, bare "create-react-native-app" project that I haven't made any change.

[Error Message on Console]

› Building app... Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

BUILD FAILED in 30s C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\android\gradlew.bat exited with non-zero code: 1 Error: C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\android\gradlew.bat exited with non-zero code: 1 at ChildProcess.completionListener (C:\Users\withe\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:65:13) at Object.onceWrapper (node:events:642:26) at ChildProcess.emit (node:events:527:28) at ChildProcess.cp.emit (C:\Users\withe\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1092:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) ... at spawnAsync (C:\Users\withe\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:26:19) at spawnGradleAsync (C:\Users\withe\AppData\Roaming\npm\node_modules\expo-cli\src\commands\run\android\spawnGradleAsync.ts:83:18) at assembleAsync (C:\Users\withe\AppData\Roaming\npm\node_modules\expo-cli\src\commands\run\android\spawnGradleAsync.ts:57:16) at actionAsync (C:\Users\withe\AppData\Roaming\npm\node_modules\expo-cli\src\commands\run\android\runAndroid.ts:143:9)

Kalph13 commented 2 years ago

I think I found some pattern:

npx create-react-native-app → "expo run:android" doesn't work

npx create-react-native-app --use-npm → "expo run:android" works well

Perhaps it's sort of a problem between "create-react-native-app" and Yarn

jeremyfrancis commented 2 years ago

How can we fix this for existing RN project?

rhalf commented 1 year ago

i have same issue on windows... however working fine on mac