5

I am trying to build my react-native project in Xcode to release in App Store but the build fails with the error

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

I am not sure how to proceed. I have facebook sdk and react-native-firebase in my project. Can you please help me what could be wrong. Thanks.

Sripaul
  • 2,227
  • 9
  • 36
  • 60

2 Answers2

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

This error mostly occur when node modules aren't correctly installed in the react-native-ios. Better check if the pods are installed correctly or the .xcodeproj are included and correctly linked with project.

react-native link

react-native link doesn't correctly link all the packages. So recheck it and it manually or using cocoapods.

If further information from the pod are shared, I can help you to find the correct module.

  • platform :ios, '9.0' target 'myapp' do pod 'Firebase/Core', '~> 5.11.0' pod 'Firebase/Auth', '~> 5.11.0' pod 'Firebase/Core', '~> 5.11.0' pod 'Firebase/Database', '~> 5.11.0' pod 'Firebase/Firestore', '~> 5.11.0' pod 'Firebase/Storage', '~> 5.11.0' pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk' pod 'FBSDKLoginKit' pod 'React', :path => '../node_modules/react-native' pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga' end – Sripaul Jan 15 '19 at 18:08
  • Above is my pod file contents. Thanks Krishnaraj! – Sripaul Jan 15 '19 at 18:09
  • I have the same error but with project initialized with react-native-cli and latest version of react native 0.71 or 0.72 , react native link does not work as it is not required. Linking part is said to be automatically taken care of. How can I solve this with the latest version of xcode and react native @Krishnaraj – catBuddy Aug 06 '23 at 06:13
  • that's right changes have been made based on latest react native. react-native link is no linger required @catBuddy – Krishnaraj Rajendran Nair Aug 12 '23 at 19:58
1

You can solve this error by doing some changes in Xcode app info.

  1. Open Xcode in application
  2. Right click and open on Get info
  3. you will find three option there, check on Open using Rosetta.
  4. Now close the Xcode completely, and then open. Now you are able to make build successfully.
Sakshi Singh
  • 57
  • 1
  • 5