question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS Xcode] React-Native build failed in Xcode with library not found in RN 0.60.5

See original GitHub issue

Steps To Reproduce

Using react-native run-ios is successfully, when I use Xcode to build and run the project, produce this error:

` ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/DoubleConversion’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/Folly’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/RCTWeChat’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/RNGestureHandler’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/RNReanimated’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/RNSVG’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-Core’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-DevSupport’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTActionSheet’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTAnimation’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTBlob’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTImage’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTLinking’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTNetwork’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTSettings’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTText’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTVibration’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTWebSocket’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-cxxreact’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-jsi’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-jsiexecutor’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-jsinspector’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/glog’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/react-native-splash-screen’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/react-native-webview’ ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/yoga’ ld: library not found for -lDoubleConversion

clang: error: linker command failed with exit code 1 (use -v to see invocation) `

My Environment:

React Native version: v 0.60.5

Xcode version : Version 10.0 (10A255)

Podfile:

`platform :ios, ‘9.0’ require_relative ‘…/node_modules/@react-native-community/cli-platform-ios/native_modules’

target ‘example’ do pod ‘React’, :path => ‘…/node_modules/react-native/’ pod ‘React-Core’, :path => ‘…/node_modules/react-native/React’ pod ‘React-DevSupport’, :path => ‘…/node_modules/react-native/React’ pod ‘React-RCTActionSheet’, :path => ‘…/node_modules/react-native/Libraries/ActionSheetIOS’ pod ‘React-RCTAnimation’, :path => ‘…/node_modules/react-native/Libraries/NativeAnimation’ pod ‘React-RCTBlob’, :path => ‘…/node_modules/react-native/Libraries/Blob’ pod ‘React-RCTImage’, :path => ‘…/node_modules/react-native/Libraries/Image’ pod ‘React-RCTLinking’, :path => ‘…/node_modules/react-native/Libraries/LinkingIOS’ pod ‘React-RCTNetwork’, :path => ‘…/node_modules/react-native/Libraries/Network’ pod ‘React-RCTSettings’, :path => ‘…/node_modules/react-native/Libraries/Settings’ pod ‘React-RCTText’, :path => ‘…/node_modules/react-native/Libraries/Text’ pod ‘React-RCTVibration’, :path => ‘…/node_modules/react-native/Libraries/Vibration’ pod ‘React-RCTWebSocket’, :path => ‘…/node_modules/react-native/Libraries/WebSocket’ pod ‘RNSVG’, :path => ‘…/node_modules/react-native-svg’

pod ‘React-cxxreact’, :path => ‘…/node_modules/react-native/ReactCommon/cxxreact’ pod ‘React-jsi’, :path => ‘…/node_modules/react-native/ReactCommon/jsi’ pod ‘React-jsiexecutor’, :path => ‘…/node_modules/react-native/ReactCommon/jsiexecutor’ pod ‘React-jsinspector’, :path => ‘…/node_modules/react-native/ReactCommon/jsinspector’ pod ‘yoga’, :path => ‘…/node_modules/react-native/ReactCommon/yoga’

pod ‘DoubleConversion’, :podspec => ‘…/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec’ pod ‘glog’, :podspec => ‘…/node_modules/react-native/third-party-podspecs/glog.podspec’ pod ‘Folly’, :podspec => ‘…/node_modules/react-native/third-party-podspecs/Folly.podspec’

pod ‘RNSVG’, :path => ‘…/node_modules/react-native-svg’

target ‘exampleTests’ do inherit! :search_paths end

use_native_modules! end

target ‘example-tvOS’ do target ‘example-tvOSTests’ do inherit! :search_paths end

end`

Describe what you expected to happen:

  1. run react-native run-iosand react-native run-android was both successfully.
    2.but use Xcode build button failed.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:41 (1 by maintainers)

github_iconTop GitHub Comments

94reactions
EYYCHEEVcommented, Nov 19, 2019

I had the same problem when I tried to run the app on my iPhone. I used CocoaPods as a workaround. I followed the suggestions on Stackoverflow

My environment: react-native: 0.61 Xcode: 11.2.1

My steps to fix the issue:

  1. $ cd ios
  2. open YourProject.xcworkspace instead of YourProject.xcodeproj with Xcode
  3. Build and run the selected target

Voila, it works for me. Hope this helps. 🤞🏼

89reactions
JslinSircommented, Aug 20, 2019

any suggestion or solution ?

Do the below steps

go to ios/ run ‘pod install’ or ‘pod update’ open ios/newproject.xcworkspace

Read more comments on GitHub >

github_iconTop Results From Across the Web

After upgrading to React Native 0.60.5 iOS release build gives ...
I've found a solution in this Stack Overflow post. Following these steps you can create a main.jsbundle and assets folder and add it...
Read more >
Using Hermes - React Native
First, ensure you're using at least version 0.60.4 of React Native to enable Hermes on Android or 0.64 of React Native to enable...
Read more >
Troubleshooting - React Native
Missing libraries for React​. If you added React Native manually to your project, make sure you have included all the relevant dependencies ...
Read more >
Linking Libraries - React Native
React Native will link your libs based on dependencies and devDependencies in your package.json file. That's it! Next time you build your app ......
Read more >
Troubleshooting - React Native
This error indicates that the codegen script that is injected into the Xcode build pipeline has exited early. You may get this for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found