React-native: linker command failed with exit code 1

Created on 3 Nov 2018  路  9Comments  路  Source: facebook/react-native

Environment

React Native Environment Info:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz
Memory: 1.23 GB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.8.0 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.2.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
Build Tools: 23.0.1, 23.0.2, 23.0.3, 24.0.1, 25.0.0, 25.0.1, 25.0.2, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.2, 27.0.3, 28.0.2
API Levels: 10, 21, 23, 24, 25, 26, 27, 7
IDEs:
Android Studio: 3.0 AI-171.4443003
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.4.1 => 16.4.1
react-native: 0.56.0 => 0.56.0
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
react-native-rename: 2.2.2

Description

When i build via xcode 10.1 I got error

ld: warning: directory not found for option '-L/Users/gifary/Library/Developer/Xcode/DerivedData/hellobeautyvendor-buwtwjsnileccuckwrfwdxvbwidb/Build/Products/Debug-iphonesimulator/React'
ld: library not found for -lRNFirebase
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reproducible Demo

I open project .xcworkspace and run with emulator

Locked

Most helpful comment

@vemundeldegard thanks a lot, that's work by deleting library doesn't exist.

All 9 comments

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The "鈴狾ld Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

Try deleting your node_modules and running yarn or npm install again to reinstall your dependencies, then clean the project in Xcode. If that doesn't work, this is probably an issue with react-native-firebase. There are some similar issues here: https://github.com/invertase/react-native-firebase/issues

I had this issue a few weeks ago.

As the error says there is something wrong in your Xcode project and the linked libarires you have added. I suggest checking if you are adding some libraries that does not exist or should not be added. I removed linker, and the issue was solved.

@vemundeldegard thanks a lot, that's work by deleting library doesn't exist.

@vemundeldegard or @gifary could you guys explain how how to "remove linker" ??

@coryb08 just open .xcworkspace in xcode an find the library doesn't exist at library folder

react-native link in the root directory of the project solved the problem for me.

I just updated React Native to version 0.60.0 today and now i am getting the same error. For debugging, i created a fresh new project via react-native init Blank. Running the blank project via react-native run-ios works without any problem but starting the blank project from within Xcode doesn't work because

ld: warning: directory not found for option '-L/Users/iwan_uschka/Library/Developer/Xcode/DerivedData/Blank-buuuhanmafucpqhebeygzipdxioc/Build/Products/Debug-iphonesimulator/yoga'
ld: library not found for -lDoubleConversion
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My system:

Mac OS X 10.13.6
Xcode 10.1
Node v12.6.0
react 16.8.6
react-native 0.60.0
react-native-cli 2.0.1

Ok, after reading

Maybe you open xcode with the XXX.xcodeproj and you must open xcode with the XXX.xcworkspace

at https://github.com/react-native-community/react-native-maps/issues/2829#issuecomment-488816768 and discovering some official statement

CocoaPods will instruct you to use the generated .xcworkspace file henceforth to be able to use these installed dependencies.

at https://facebook.github.io/react-native/docs/troubleshooting#missing-libraries-for-react i tried using my xcworkspace file and it worked (iOS simulator and connected device).

Was this page helpful?
0 / 5 - 0 ratings