iOS build: command ld failed with a nozero exit code - xcode

For a react-native project, I got the following error during Xcode build:
clang: error: no such file or directory: '/Users/user172615/Library/Developer/Xcode/DerivedData/xxx/Build/Products/Debug-appletvsimulator/libBVLinearGradient.a'
Command Ld failed with a nonzero exit code
This happened after adding react-native-linear-gradient, and following the instructions in https://github.com/react-native-community/react-native-linear-gradient (manual installation for iOS).
As specified in https://github.com/react-native-community/react-native-linear-gradient#manually, libBVLinearGradient.a is included in Build Phases -> Link Binary With Libraries for the target myProject
libBVLinearGradient.a is also included in General -> Frameworks, Libraries and embedded content.
I tried deleting DerivedData, and rebuilding. Didn't help.
Since the error indicates Debug-appletvsimulator, I included libBVLinearGradient.a in Build Phases -> Link Binary With Libraries for the target myProject-tvOS
When this didn't help, I deleted the myProject-tvOS target. All didn't help.
I am using Xcode 11.3, react-native 0.59.9.
Any idea?

Instead of downloading it, do this instead.
Click on clone existing project
Then copy this link
https://github.com/react-native-community/react-native-linear-gradient
And paste the link here
Then it will download the project.
If the problem still happens, then create a new project, copy and paste everything.

Related

xcode librarby not found for -IRCTNetwork

I have react native project that I'm trying to run with xcode.
when i run it shows me the error
ld: library not found for -lRCTNetwork
clang: error: linker command failed with exit code 1 (use -v to see invocation)
actually, i don't know what is -RCTNetwork,
it's not any plugin I installed.
This error occurs because you haven't added or linked the network library to your Build Phases in Xcode.
Drag the file, RCTNetwork.xcodeproj from node_modules/react-native/Libraries/Network/
to the libraries file in Xcode.
Then click on Build Phases on the top right-hand corner in Xcode.
Click the drop down of Link Binary With Libraries, then the + sign to add the libRCTNetwork.a
Run the build and restart your emulator or device.

XCode tests. Clang: error: linker command failed with exit code 1 for FBSDKCoreKit

I added new Tests target to my project, but I have this error even I don't use any FBSDKCoreKit dependencies in the tests. Generally I use CocoaPods, but not for FBSDKCoreKit framework. Tried everything — no results.
ld: framework not found FBSDKCoreKit
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Normal Run builds are working perfectly, just tests are not running.
In the test target settings:
My mistake. I just didn't follow all steps from FB doc:
Drag the FBSDKCoreKit.framework, FBSDKLoginKit.framework, and FBSDKShareKit.framework files into the Frameworks group of Xcode's Project Navigator. In the displayed dialog, choose Create groups for any added folders and deselect Copy items into destination group's folder. This references the SDK where you installed it rather than copying the SDK into your app.
Open Xcode's Build Settings tab in your project.
Add ~/Documents/FacebookSDK to the project's Framework Search Paths setting.
https://developers.facebook.com/docs/ios/getting-started/

Xcode linker command failed with exit code 1

I'm having an annoying problem with Xcode. I can't run the projects and it gives me back the same error every time:
ld: file not found: /Users/DagDigg/Library/Developer/Xcode/DerivedData/Roundy2-dtzcccrlvjvoxsapfbdzchhtuivr/Build/Intermediates/Roundy2.build/Debug-iphoneos/Roundy2.build/Objects-normal/arm64/AppDelegate.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm unable to run every project. Even if I create an empty one...
I'm using Xcode 7 beta 3 and an iPhone with iOS 9 beta 4.
Sometimes it's helpful to quit Xcode and erase the files in your DeriveData folder at
~/Library/Developer/Xcode/DerivedData
I've also fixed this issue by going to Product -> Clean in XCode. This might erase the files in the files in the Derived Data folder in the process.
Clean build folder + Rebuild the project worked for me.
Step 1: product -> Clean Build Folder
Step 2: product -> Build
Usualy this issue occur while you run your project on simulator devices ,
and simply you can remove DerivedData folder to pass this
But i suggest you to use real devices 🤞🏻
Maybe double-check the Xcode file you are running. Close the Xcode project then be sure to open the <projectname>.xcworkspace file.
If you are using cocoapods, the error can be from trying to build from the .xcodeproj file instead of the .xcworkspace file generated by the pod install.
"Open the MyApp.xcworkspace that was created. This should be the file you use everyday to create your app." - guides.cocoapods.org/using/using-cocoapods

Swift 2.0 import and compile with sqlite3 library

Trying to test some sqlite with Swift 2 but I cannot make a correct build when adding the libsqlite3.0.tbd file on the Link Binary with libraries. I also tried to add the libsqlite3.dylib from /usr/lib but I get the following error.
ld: library not found for -lsqlite3
clang: error: linker command failed with exit code 1 (use -v to see invocation)
any idea on how can I correctly build with the library. It is just an empty project just for testing. Thanks a lot in advance.
Seeing this here as well. I am assuming the 'tbd' means 'to be done', as in, the library still needs to be built for the OSX 10.11 SDK. Should disappear in the next beta...
Meanwhile, it can be fixed by going to your project's settings -> Build Phases -> Link with binaries. Click '+', then click 'Add other'. Now hit Cmd-Shift-G and navigate to /usr/lib. There, you can select libsqlite3.dylib. Now your project should build without error.
In order to prevent errors when moving the XCode project around, make sure the reference to libsqlite3.dylib uses an absolute path (click on the .dylib in the file list, then go to the properties pane and select 'absolute path')
Meanwhile, you can use libsqlite3.dylib from previous SDK. open terminal, type
locate libsqlite3.dylib
You'll find several files like these:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libsqlite3.dylib
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libsqlite3.dylib
Go to your project's setting -> Build Phases -> Link with Binaries. Add BOTH files by clicking +, then Add Other. Hit Cmd-Shift-G, and copy-paste the file path. Click Open.
If you install sqlite3 using macports, remove /opt/local/lib from Library Search Path in Build Settings.

library not found for -lBaiduMapApi

I use cocoaPods in my current project.
Because the 'Baidu map iOS SDK' don't have a pod spec so I just create one.
The 'Baidu map iOS SDK' use a '.a' static library and some header files, I add them into my project through cocoaPods
But when I build my project, it always has an error:
ld: library not found for -lBaiduMapApi
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I google it then I try to set the Library Path in Xcode.
Both in my project and the target in Pods.
I am sure the path is correct, but the error still there.
Can somebody help me?
It's weird......
I remove whole my project and Recreate a new one.
And config the Podfile, update .....
When I back to the Xcode, build, Success!!!
I can find another way to solve this problems

Resources