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

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.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 41 (2 by maintainers)

Most upvoted comments

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. 🤞🏼

any suggestion or solution ?

Do the below steps

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

I had the same issue, I updated my podfile with platform :ios, '11.0', but I forgot to set the target iOS version from 9 to 11 🙃

thanks @EugeneYiminYan this is perfect answer you can close this issue now

After much frustration, this ‘fix’ worked for me: Delete the [YourApp]Tests target. I don’t think that be needed by most developers anyways.

In my case, I had to change the Deployment Info to iOS 11.0

image

I have no idea if this would help, but sometimes for my own app, attempting to build in Xcode multiple times in a row may result in a successful build. For example, I would try building ~5 times (each with a different ‘file not found’ error), and on the 6th time the build would succeed.

if i recall correctly, the fix for me was the following change in the Fastfile

platform :ios do
  xcodeproj = './ios/MyApp.xcodeproj'
+ xcworkspace = './ios/MyApp.xcworkspace'

  ...

  desc 'Build the iOS app'
  lane :build do
    certificates
-   gym(scheme: 'MyApp', project: xcodeproj)
+   gym(scheme: 'MyApp', workspace: xcworkspace)
  end

  ...

Hey guys, Any update for this issue, I am also facing this issue after upgrading from 0.57.8 to 0.62. Any help will be really appreciated

It appears we got through our issue upgrading from 0.59 to 0.60. Maybe this will be helpful to you:

Many of the libraries we were linking to in the “Link Binary with Libraries” build step in Xcode were now present in Cocoapods. By removing all of the libraries from that build step except for libPods-Qeepsake, we were able to get past the DoubleConversion error and the build now works.

same Problem Upgraded to react-native 0.60.5 XCode Version 10.3

same here. react-native Version 0.61.4 XCode Version 11.1

Having the a similar problem with my midsized project after upgrading to 0.60.5. It actually fails at finding CocoaLumberjack, but I expect this to be the case because of dependency and sorting. I am not 100% sure, but release builds seem to be rather the problem than debug builds?!

I use AppCenter as my CI. I created this minimalist project (just react-native init) which also fails building there (this one actually fails at finding DoubleConversion). Bitbucket Repo

I currently expect a problem with the generated .xcworkspace file, but that’s a part I didn’t dig into yet.

Here are the logs of the minimalist iOS build that fails. logs_2.zip

the same

Having the a similar problem with my midsized project after upgrading to 0.60.5. It actually fails at finding CocoaLumberjack, but I expect this to be the case because of dependency and sorting. I am not 100% sure, but release builds seem to be rather the problem than debug builds?!

I use AppCenter as my CI. I created this minimalist project (just react-native init) which also fails building there (this one actually fails at finding DoubleConversion). Bitbucket Repo

I currently expect a problem with the generated .xcworkspace file, but that’s a part I didn’t dig into yet.

Here are the logs of the minimalist iOS build that fails. logs_2.zip

Same thing here – on both Xcode and react-native run-ios. None of these suggestions have helped. This is a project that is being upgraded from RN 0.59 to 0.60.5.

Still having this issue… none of these solutions helped…

Hi guys, in fact, I don’t know the real cause of this problem and how to fixed this issue.but

I JUST UPDATE MY Xcode VERSION FROM 10.0 (10A255) TO 10.3 (10G8), REOPEN AND REBUILD

IT WORKS . 😢