Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kalph13 opened this issue May 14, 2022 · 3 comments
Open

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

Kalph13 opened this issue May 14, 2022 · 3 comments

Comments

@Kalph13
Copy link

Kalph13 commented May 14, 2022

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.

  • Where:
    Script 'C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 256

  • What went wrong:
    A problem occurred evaluating script.

React Native CLI failed to determine Android project configuration. This is likely due to misconfiguration. Config output:
[root:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022, reactNativePath:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\node_modules\react-native, dependencies:[expo:[root:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\node_modules\expo, name:expo, platforms:[ios:[sourceDir:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\node_modules\expo\ios, folder:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\node_modules\expo, pbxprojPath:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\node_modules\expo\ios\Expo.xcodeproj\project.pbxproj, podfile:null, podspecPath:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\node_modules\expo\ios\Expo.podspec, projectPath:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\node_modules\expo\ios\Expo.xcodeproj, projectName:Expo.xcodeproj, libraryFolder:Libraries, sharedLibraries:[], plist:[], scriptPhases:[], configurations:[]], android:null], assets:[], hooks:[:], params:[]]], commands:[[name:log-ios, description:starts iOS device syslog tail], [name:run-ios, description:builds your app and starts it on iOS simulator, examples:[[desc:Run on a different simulator, e.g. iPhone SE (2nd generation), cmd:react-native run-ios --simulator "iPhone SE (2nd generation)"], [desc:Pass a non-standard location of iOS directory, cmd:react-native run-ios --project-path "./app/ios"], [desc:Run on a connected device, e.g. Max's iPhone, cmd:react-native run-ios --device "Max's iPhone"], [desc:Run on the AppleTV simulator, cmd:react-native run-ios --simulator "Apple TV" --scheme "helloworld-tvOS"]], options:[[name:--simulator , description:Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: "iPhone 6 (10.0)", default:iPhone 13], [name:--configuration , description:Explicitly set the scheme configuration to use, default:Debug], [name:--scheme , description:Explicitly set Xcode scheme to use], [name:--project-path , description:Path relative to project root where the Xcode project (.xcodeproj) lives., default:ios], [name:--device [string], description:Explicitly set device to use by name. The value is not required if you have a single device connected.], [name:--udid , description:Explicitly set device to use by udid], [name:--no-packager, description:Do not launch packager while building], [name:--verbose, description:Do not use xcbeautify or xcpretty even if installed], [name:--port , default:8081], [name:--terminal , description:Launches the Metro Bundler in a new window using the specified terminal path.]]], [name:log-android, description:starts logkitty], [name:run-android, description:builds your app and starts it on a connected Android emulator or device, options:[[name:--root , description:[DEPRECATED - root is discovered automatically] Override the root directory for the android build (which contains the android directory), default:], [name:--variant , description:Specify your app's build variant, default:debug], [name:--appFolder , description:[DEPRECATED ?? use "project.android.appName" in react-native.config.js] Specify a different application folder name for the android source. If not, we assume is "app"], [name:--appId , description:Specify an applicationId to launch after build. If not specified, package from AndroidManifest.xml will be used., default:], [name:--appIdSuffix , description:Specify an applicationIdSuffix to launch after build., default:], [name:--main-activity , description:Name of the activity to start, default:MainActivity], [name:--deviceId , description:builds your app and starts it on a specific device/simulator with the given device id (listed by running "adb devices" on the command line).], [name:--no-packager, description:Do not launch packager while building], [name:--port , default:8081], [name:--terminal , description:Launches the Metro Bundler in a new window using the specified terminal path.], [name:--tasks , description:Run custom Gradle tasks. By default it's "installDebug"], [name:--no-jetifier, description:Do not run "jetifier" ?? the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet. See more at: https://www.npmjs.com/package/jetifier.], [name:--active-arch-only, description:Build native libraries only for the current device architecture for debug builds., default:false]]]], assets:[], healthChecks:[], platforms:[ios:[:], android:[:]], project:[ios:[sourceDir:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\ios, folder:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022, pbxprojPath:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\ios\reactnativepersonalapp2022.xcodeproj\project.pbxproj, podfile:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\ios\Podfile, podspecPath:null, projectPath:C:\Visual Studio Code\Tutorial_React Native Master\reactnative_personal_app_2022\ios\reactnativepersonalapp2022.xcodeproj, projectName:reactnativepersonalapp2022.xcodeproj, libraryFolder:Libraries, sharedLibraries:[], plist:[], scriptPhases:[]], android:null]]

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

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
Copy link
Author

Kalph13 commented May 15, 2022

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
Copy link

How can we fix this for existing RN project?

@rhalf
Copy link

rhalf commented Jan 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants