Search code examples
iosxcodereact-nativereact-native-cli

using React-native init, a new iOS app can't build in Xcode, build error 'ld: library not found for -lDoubleConversion


steps to reproduce:

react-native init FirstProject cd FirstProject open ios/FirstProject.xcodeproj

... Xcode opens the project:

enter image description here

I select build target iOS Simulator -> Iphone XR

A terminal window opens in the background:

enter image description here

However, Xcode returns a build error:

ld: library not found for -lDoubleConversion
clang: error: linker command failed with exit code 1 (use -v to see invocation)

shown with warnings here https://gist.github.com/jasonfb/7b51a260df419590c6fadda93fb49348

enter image description here


Solution

  • You should be opening the workspace, not the project file as indicated per instructions at the end of the project creation script:

        • cd "/Users/xxx/FirstProject" && npx react-native run-ios
        - or -
        • Open FirstProject/ios/FirstProject.xcworkspace in Xcode or run "xed -b ios"
        • Hit the Run button```