ld: file not found: linker command failed with exit code 1
You might be getting this error because you renamed your project and Tests
cannot be found anymore. This is easy to fix:
Solve it in Xcode like this:
- Select your project from the project navigator.
- Select
[Your project's Tests]
under targets - Under
General
tab change theHost Application
from the drop down - Build and run.
This problem happened to me because I renamed my project and the tests could't find it anymore.
error linker command failed with exit code 1 (use -v to see invocation)
You can relink those things "Build settings->Linking->Other Linker Flags"
- AFNetworking
- MGSwipeTableCell
- MJRefresh
- iRate
Is it your project? Sometime , the code people shared in Internet could lack of some lib.
Xcode 10 Error: linker command failed with exit code 1
Open the projectname.xcworkspace if you are using cocoapods not the projectname.xcodeproj.
Alternatively, using terminal
$ open projectname.xcworkspace
Hope this helps.
linker command failed with exit code 1 when building Unity project in Xcode
I finally found the solution, it was linked to the UnityFramework target in Xcode. I had to remove some architectures that are not concerned by my build: i386 and x86_64. In addition, I updated the Library Search Paths to include $(SDKROOT)/usr/lib/swift.
To execute those actions automatically, you can add those lines in a PostProcessBuild file in your Unity project:
var projPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj";
var proj = new PBXProject();
proj.ReadFromFile(projPath);
// Update the Library Search Paths of the whole Xcode project
proj.AddBuildProperty(proj.ProjectGuid(), "LIBRARY_SEARCH_PATHS", "$(SDKROOT)/usr/lib/swift");
// Get the UnityFramework target and exclude the unwanted architectures
var unityFrameworkGuid = proj.TargetGuidByName("UnityFramework");
proj.SetBuildProperty(unityFrameworkGuid, "EXCLUDED_ARCHS", "i386");
proj.AddBuildProperty(unityFrameworkGuid, "EXCLUDED_ARCHS", "x86_64");
Related Topics
Using Nsuserdefaults on Arrays
How to Validate an E-Mail Address in Swift
Uisplitviewcontroller in Portrait on Iphone Shows Detail Vc Instead of Master
How to Play a Local Video With Swift
Shouldautorotatetointerfaceorientation Not Being Called in iOS 6
How to Add Image and Text in Uitextview in Ios
In Ios13 the Status Bar Background Colour Is Different from the Navigation Bar in Large Text Mode
Replacement For Deprecated -Sizewithfont:Constrainedtosize:Linebreakmode: in iOS 7
Run App For More Than 10 Minutes in Background
How to Set Bold and Italic on Uilabel of Iphone/Ipad
Retrieving Carrier Name from iPhone Programmatically
Uitableview with Fixed Section Headers
How to Launch Safari from an iPhone App
How to Navigate from One View Controller to Another Using Swift