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.

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

See original GitHub issue

Description

We are trying to put an iOS build using react native but our build got stuck with the below error. kindly help us resolve this issue.

we are using cocoapods: 1.8.4 version

clang: error: linker command failed with exit code

React Native version:

“dependencies”: { “@react-native-community/masked-view”: “^0.1.7”, “@react-navigation/drawer”: “^5.4.1”, “@react-navigation/native”: “^5.1.4”, “@react-navigation/stack”: “^5.2.9”, “@react-navigation/material-top-tabs”: “5.1.7”, “@react-navigation/material-bottom-tabs”: “^5.1.7”, “react”: “16.11.0”, “react-native”: “0.61.5”, “react-native-gesture-handler”: “^1.6.1”, “react-native-reanimated”: “^1.7.1”, “react-native-safe-area-context”: “^0.7.3”, “react-native-tab-view”: “^2.13.0”, “react-native-vector-icons”: “^6.6.0”, “react-native-screens”: “^2.4.0” }, “devDependencies”: { “@babel/core”: “^7.6.2”, “@babel/runtime”: “^7.6.2”, “@react-native-community/eslint-config”: “^0.0.5”, “babel-jest”: “^24.9.0”, “eslint”: “^6.5.1”, “jest”: “^24.9.0”, “metro-react-native-babel-preset”: “^0.59.0”, “react-test-renderer”: “16.13.1” },

Steps To Reproduce

I excure the below command we got the error "clang: error: linker command failed with exit code 1 " /Applications/Xcode_11_3_1.app/Contents/Developer/usr/bin/xcodebuild -scheme spm_mobile -configuration Release archive -archivePath /Users/macbuild/WH_DIR/Apr_20_2020/SPM_MOBILE_IOS/3025072/MACSRC/build/…/ios/spm_mobile.xcarchive -workspace spm_mobile.xcworkspace -UseModernBuildSystem=NO

Expected Results

ld: library not found for -lCocoaAsyncSocket [sshexec] [exec] clang: error: linker command failed with exit code 1 (use -v to see invocation) [sshexec] [exec] [sshexec] [exec] ** ARCHIVE FAILED ** [sshexec] [exec] [sshexec] [exec] [sshexec] [exec] The following build commands failed: [sshexec] [exec] Ld /Users/macbuild/Library/Developer/Xcode/DerivedData/spm_mobile-awskmlvxgyrsozddnaorzehbvupe/Build/Intermediates.noindex/ArchiveIntermediates/spm_mobile/IntermediateBuildFilesPath/spm_mobile.build/Release-iphoneos/spm_mobile.build/Objects-normal/armv7/spm_mobile normal armv7 [sshexec] [exec] Ld /Users/macbuild/Library/Developer/Xcode/DerivedData/spm_mobile-awskmlvxgyrsozddnaorzehbvupe/Build/Intermediates.noindex/ArchiveIntermediates/spm_mobile/IntermediateBuildFilesPath/spm_mobile.build/Release-iphoneos/spm_mobile.build/Objects-normal/arm64/spm_mobile normal arm64 [sshexec] [exec] (2 failures) [sshexec] [exec] + GenerateArchive [sshexec] [exec] + /Applications/Xcode_11_3_1.app/Contents/Developer/usr/bin/xcodebuild -exportArchive -exportOptionsPlist /Users/macbuild/WH_DIR/Apr_20_2020/SPM_MOBILE_IOS/3025072/MACSRC/build/profiles/Appstore/exportOptions.plist -archivePath /Users/macbuild/WH_DIR/Apr_20_2020/SPM_MOBILE_IOS/3025072/MACSRC/build/…/ios/spm_mobile.xcarchive -exportPath /Users/macbuild/WH_DIR/Apr_20_2020/SPM_MOBILE_IOS/3025072/MACSRC/build/…/ios/spm_mobile.xcarchive/Products/Applications [sshexec] [exec] ** EXPORT FAILED ** [sshexec] [exec] [sshexec] [exec] error: archive not found at path ‘/Users/macbuild/WH_DIR/Apr_20_2020/SPM_MOBILE_IOS/3025072/MACSRC/ios/spm_mobile.xcarchive’ [sshexec] [exec] Result: 65 [sshexec] [echo] ExitValue from the task is : 65

Snack, code example, screenshot, or link to a repository:

The Podfile

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

source ‘https://github.com/CocoaPods/Specs.git

def add_flipper_pods! version = ‘~> 0.33.1’ pod ‘FlipperKit’, version, :configuration => ‘Debug’ pod ‘FlipperKit/FlipperKitLayoutPlugin’, version, :configuration => ‘Debug’ pod ‘FlipperKit/SKIOSNetworkPlugin’, version, :configuration => ‘Debug’ pod ‘FlipperKit/FlipperKitUserDefaultsPlugin’, version, :configuration => ‘Debug’ pod ‘FlipperKit/FlipperKitReactPlugin’, version, :configuration => ‘Debug’ end

Post Install processing for Flipper def flipper_post_install(installer) installer.pods_project.targets.each do |target| if target.name == ‘YogaKit’ target.build_configurations.each do |config| config.build_settings[‘SWIFT_VERSION’] = ‘4.1’ end end end end

target ‘spm_mobile’ do Pods for spm_mobile pod ‘FBLazyVector’, :path => “…/node_modules/react-native/Libraries/FBLazyVector” pod ‘FBReactNativeSpec’, :path => “…/node_modules/react-native/Libraries/FBReactNativeSpec” pod ‘RCTRequired’, :path => “…/node_modules/react-native/Libraries/RCTRequired” pod ‘RCTTypeSafety’, :path => “…/node_modules/react-native/Libraries/TypeSafety” pod ‘React’, :path => ‘…/node_modules/react-native/’ pod ‘React-Core’, :path => ‘…/node_modules/react-native/’ pod ‘React-CoreModules’, :path => ‘…/node_modules/react-native/React/CoreModules’ pod ‘React-Core/DevSupport’, :path => ‘…/node_modules/react-native/’ 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-Core/RCTWebSocket’, :path => ‘…/node_modules/react-native/’

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 ‘ReactCommon/jscallinvoker’, :path => “…/node_modules/react-native/ReactCommon” pod ‘ReactCommon/turbomodule/core’, :path => “…/node_modules/react-native/ReactCommon” pod ‘Yoga’, :path => ‘…/node_modules/react-native/ReactCommon/yoga’, :modular_headers => true

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 ‘RNVectorIcons’, :path => ‘…/node_modules/react-native-vector-icons’

target ‘spm_mobileTests’ do inherit! :complete Pods for testing end

use_native_modules!

Enables Flipper. Note that if you have use_frameworks! enabled, Flipper will not work and you should disable these next few lines. add_flipper_pods! post_install do |installer| flipper_post_install(installer) end end

target ‘spm_mobile-tvOS’ do Pods for spm_mobile-tvOS

target ‘spm_mobile-tvOSTests’ do inherit! :search_paths Pods for testing end end

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

4reactions
choppergripcommented, May 15, 2020

What helped me:

Xcode -> File -> Workspace settings -> Build system

Choose New Build System

0reactions
thatalihamzacommented, Aug 5, 2021

is there any solution for this problem i have tried almost all possible solutions but not able to resolve this issue yet thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

clang: error: linker command faile… | Apple Developer Forums
The error I get is: clang: error: linker command failed with exit code 1 (use -v to see invocation). How should I go...
Read more >
Linker Command failed with exit code 1 (use - Stack Overflow
Just go project-> Build Phase->Link Binary with libraries Remove the old FrameWorks by click on minus button(-) And clean and Run again. It's ......
Read more >
clang: error: linker command failed with exit code 1 (use -v to ...
clang: error: linker command failed with exit code 1 (use -v to see invocation) · This means that you linked to something that...
Read more >
What is linker command failed with exit code 1 (use - Quora
It means the link failed. This is most likely caused by an undefined external reference, or a duplicate external definition. Since you did...
Read more >
clang: error: linker command failed with exit code 1 ... - You.com
StackOverflow · With Xcode, click on your project's icon on the left, select the tab Build Phases > Compile Sources and click on...
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