I have this error
❌ ld: library not found for -lDoubleConversion
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening App.xcworkspace
** BUILD FAILED **
The following build commands failed:
Ld /Users/mohamedelmi/workspace/elmi/food-frontend/ios/build/App/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App normal x86_64
(1 failure)
here is what i did
I clean and rebuild still have the error
rm -f ~/Library/Developer/Xcode/DerivedData/ModuleCach
First of all, make sure that Libraries -> React.xcodeproj -> ThirdParty -> double-conversion exists and a static library is being produced from it, like this:
Then, if are you're using cocoapods, make sure to add DoubleConversion to your Podfile:
target 'MyApp' do
pod 'React', :path => "../node_modules/react-native", :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
# the following ones are the ones taken from "Libraries" in Xcode:
'RCTAnimation',
'RCTActionSheet',
'RCTBlob',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket'
]
pod 'yoga', :path => "../node_modules/react-native/ReactCommon/yoga"
# Here it goes
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"
end
And finally, if none of this worked so far, there's a script you can manually run
in order to resolve React's third-party dependencies.
Just go to node_modules/react-native and type:
$ ./scripts/ios-install-third-party.sh
Important: Always run it inside node_modules/react-native. Because, as far as I know, the script uses relative paths in order to store third-party's source code and react native will always look for it at node_modules/react-native/third-party. So just make sure to run it in the right place.
Note: This script is, probably, already running as a build phase on your project.
I followed the answers on Why linker link static libraries with errors? iOS but nothing worked for me since I was combining the answers.
I got it to work by ONLY doing the "create new Swift-file"-trick. So remove everything, do a fresh install and only add a new Swift-file that will create the Bridging Header (dont delete the Swift-file).
This is what finally worked for me.
pod deintegrate
pod install
Open project in X-Code
Remove Resources folder from left sidebar
Build your project from New Build System.
This is what finally worked for me. (Before proceeding, make sure pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' is included in your podfiles
1. cd ios
2. Delete Podfile.lock
3. pod deintegrate
4. pod install
5. cd ..
6. rm -rf node_modules && yarn
7. Add use_frameworks! to your Podfile
Run react-native-run-ios or Build with Xcode by opening the xcworkspace file in your ios directory.
Related
In Xcode, I get the following error during archiving
Showing All Messages
: Directory not found for option '-L/Users/<user>/Library/Developer/Xcode/DerivedData/Mobile-ffdrrqgiyphlinerkjxrqqqeocrs/Build/Intermediates.noindex/ArchiveIntermediates/Mobile/BuildProductsPath/Release-iphoneos/React'
ld: library not found for -lRNFirebase
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I get this error when I try to archive it.
When I try to build it using the command
$ react-native run-ios
in the terminal (with $ react-native start to run metro bundler), I get:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening Mobile.xcworkspace
** BUILD FAILED **
The following build commands failed:
Ld build/Mobile/Build/Products/Debug-iphonesimulator/Mobile.app/UmappedMobile normal x86_64
(1 failure)
Podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '10.3'
target 'Mobile' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
libPath = '..'
nodeModules = "#{libPath}/node_modules"
rn_path = "#{nodeModules}/react-native"
# Pods for Mobile
pod 'yoga', path: "#{rn_path}/ReactCommon/yoga"
pod 'React', path: rn_path, subspecs: [
'Core',
'CxxBridge',
'DevSupport',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
]
pod 'RNFBApp', :path => '../node_modules/#react-native-firebase/app'
pod 'RNFBDatabase', :path => '../node_modules/#react-native-firebase/database'
pod 'RNFBAuth', :path => '../node_modules/#react-native-firebase/auth'
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"
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
end
package.json:
"dependencies": {
"#react-native-firebase/app": "^7.2.1",
"#react-native-firebase/auth": "^8.0.5",
"#react-native-firebase/database": "^7.2.2",
"react": "16.8.3",
"react-native": "0.59.10",
...
}
I've tried clearing my node_modules and Pods folder within ios. Been trying to debug this for a while, any help is appreciated. Thanks!
I would recommend that:
Delete the package-lock.json, and do an npm install
Considering that these firebase packages have the auto-link feature, perform a pod install previously deleting the Podfile.lock.
In the xcode, carry out the Clean Build Folder.
Perform the build
I have developed the “SampleApp iOS framework” with swift development and using the below dependencies in our app:
pod 'Alamofire', '4.9.1'
pod 'JGProgressHUD', '2.0.3'
pod 'FirebaseCore', '6.4.0'
pod 'FirebaseMessaging', '4.1.10'
We can able to integrate the my “SampleApp framework” in the native swift application and it’s working file. But while integrated and run the same framework in the react native project. I am getting the below error
dyld: Library not loaded: #rpath/Alamofire.framework/Alamofire
Referenced from: /private/var/containers/Bundle/Application/F50D-C62F291D4-8E6B-07B23BA0D-C6-B2E9-91AE/MyFirstApp.app/Frameworks/SampleApp.framework/SampleApp
Reason: image not found
Steps to be followed for integrating SDK in reaction native is below:
1.Installed and run the node
2.sudo chown -R $USER /usr/local/lib/node_modules
3.react-native init MyFirstApp
iOS and android folders are generated.
5.I have opened the sample app framework and added my dependencies in pod install then run the pod install command.
6.Run the app in the Xcode Run option. App gets opened and getting the above alamo fire error
target 'FirstApp' do
# Pods for FirstApp
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
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 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'Alamofire', '4.9.1'
pod 'JGProgressHUD', '2.0.3'
pod 'FirebaseCore', '6.4.0'
pod 'FirebaseMessaging', '4.1.10'
Note: I have not used the Visual studio, I just open the iOS folder and do all changes same as native app. Is any other things needs to be added for react native project?
I just wanted to compile the sample app without error.
To install a library in react native we have to follow this process.
suppose you want to install keyboard library,
npm i react-simple-keyboard
so we have to run to this command, it will add react-simple-keyboard dependencies in package.json which react-native app will use as a reference, next you need to install your pods
pod install
Have you tried adding "use_frameworks!" in the Podfile to allow importing the framework dependencies ?
I tried doing a clean build, uninstalling/reinstalling pods, not too sure where to go to next.
I never received this error before, but I first got it when I tried integrating Firebase into my project. I made sure to add all of the correct pods, I then went ahead and added a few other Firebase pods, just in case. I'm not sure if it has anything to do with this, but here is what my pods file looks like.
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Effortflex' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
use_modular_headers!
# Pods for Effortflex
pod 'RealmSwift'
pod 'IQKeyboardManagerSwift'
pod 'Firebase'
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'FirebaseFirestoreSwift'
end
Here is a sample of the error...
/Users/owner1/Library/Developer/Xcode/DerivedData/Effortflex-bmtqbbukvlosxpbraqoiwplpcfyj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/pb_encode.o
duplicate symbol '_pb_encode_fixed32' in:
/Users/owner1/Library/Developer/Xcode/DerivedData/Effortflex-bmtqbbukvlosxpbraqoiwplpcfyj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/pb_encode 2.o
/Users/owner1/Library/Developer/Xcode/DerivedData/Effortflex-bmtqbbukvlosxpbraqoiwplpcfyj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/pb_encode.o
ld: 34 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any help would be greatly apprecaited!
Something that helped me was to the following -
In terminal navigate to your project folder
Run 'pod deintegrate'
Run 'pod install'
After that my project was able to compile. Hope that works for you!
I updated pods for SalesforceSDKCore 4.3.1 and SalesforceRESTApi 4.3.1. When I did pod install it in turn installed cocoaLumberjack library which is a dependent library I suppose. After successful install of Pods, I couldn't build successfully, as I am getting this error -
ld: library not found for -lCocoaLumberjack
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I deleted my Library search paths, added/deleted inerited in Other linker Flags, nothing seem to work. These are my search path and other linker flag settings.
My Pod file -
# platform :ios, '8.0'
target 'Custom' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for Custom
source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
pod 'SalesforceSDKCore'
pod 'XMLDictionary', '~> 1.4'
pod 'SalesforceNetwork'
pod 'SmartStore'
pod 'SmartSync'
end
I had the same problem. I tried many solutions, some of them are:
File/Workspace Settings/Derived Data Arrow -> Delete DerivedData folder, empty trash
Terminal -> pod deintegrate , pod install
If you renamed your target's name, then:
Target/Build Settings/Test Host :: $(BUILT_PRODUCTS_DIR)/TargetName.app/TargetName
I really hate this linker command failed problem. I get it all the time and every time I need to follow another solution to solve this. I must have given over 30 hours of my life to this s#$t.
XCode7
this is my Podfile
platform :ios, '7.0'
pod 'XMLDictionary'
pod 'Base64nl'
pod 'ASIHTTPRequest'
pod 'AFNetworking'
pod 'MWPhotoBrowser'
pod 'PinYin4Objc'
pod 'Pingpp'
New project pod after the install is an error
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What's the problem?
How to solve?
After installing CocoaPods , you must re-open your project using *****.xcworkspace file , NOT ****.xcodeproj file. Otherwise you would get this error.