react-native: `npx react-native init` new application won't run (React Native 0.66, macOS 11.6, Xcode 13.0)

Description

** BUILD FAILED ** The following build commands failed: CompileC /Users/my-username/Library/Developer/Xcode/DerivedData/AwesomeProject-gosjsvksbvgusscazfjiagvwmfqy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/FileUtil.o /Users/my-username/AwesomeProject/ios/Pods/RCT-Folly/folly/FileUtil.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target ‘RCT-Folly’ from project ‘Pods’) (1 failure)

React Native version:

System: OS: macOS 11.6 CPU: (16) x64 Intel® Core™ i9-9880H CPU @ 2.30GHz Memory: 365.40 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 12.19.0 - ~/.nvm/versions/node/v12.19.0/bin/node Yarn: 1.22.11 - /usr/local/bin/yarn npm: 6.14.8 - ~/.nvm/versions/node/v12.19.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0 Android SDK: Not Found IDEs: Android Studio: 3.6 AI-192.7142.36.36.6392135 Xcode: 13.0/13A233 - /usr/bin/xcodebuild Languages: Java: 14.0.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.66.0 => 0.66.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps To Reproduce

  1. Run the following commands as shown on the Get Started page of the docs, to create a new application:
  • npx react-native init AwesomeProject
  • cd AwesomeProject
  • npx react-native start
  1. In a new terminal while Metro is running, run the following command:
  • npx react-native run-ios

Expected Results

Expect the application to run on the simulator successfully.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 21 (1 by maintainers)

Most upvoted comments

I was able to get past this error by creating a new RN project inside a different parent folder

No problem!I feel the same way about it and was surprised the folder name could cause this but at least it works now haha.

If anyone figures out why this happens, please let me know 😃

My theory was maybe certain characters in the folder path cant be processed in xcode

@robertthecoder Your solution worked! Thank you!

CC @azzastudios @dawinValenzuela

SOLUTION: Use a different parent directory

I simply tried the exact same commands from my Desktop and a new project built and ran first time! Obviously this isn’t perfect, as I would like to continue having my projects located in the existing directory I’ve been using, but this at least means we know it’s related to a location, and I can continue development.

I don’t know how to resolve the issue in the original location, i.e. /my-username/my-apps, but perhaps someone else does?

Until this, everything I had tried had not solved the issue, but the errors were so inconsistent it was almost impossible to debug.

I have the same issue