Xcode 10 Beta 5 — clang: error: linker command failed with exit code 1
Ok.. It turned out that something in Fabric and/or Crashlytics was wrong. Since it's not essential for the app I tried to remove both pods and voila it builds and runs.
Clang: error: linker command failed with exit code 1 (use -v to see invocation) Xcode 10, Xcode 10.1 Beta, Swift 4.2
There libraries are not updated for Swift 4.2
. This issue comes for any library that is missing the version attribute(s.swift_version = '4.2'
) in .podspec
file. Also .swift-version
is deprecated so that also needs to be removed for any of the pod. Now, either you can open issues so the developers can update their libraries for Swift 4.2
or you can fork and make the changes yourself and then point your repo. in pods. Last option is to use Xcode 9.4.1
until libraries are not updated.
Xcode linker command failed with exit code 1
Sometimes it's helpful to quit Xcode and erase the files in your DeriveData folder at
~/Library/Developer/Xcode/DerivedData
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");
Linker command failed with exit code 1 (use -v to see invocation) with Swift 3
I ran into the error migrating to swift3. As it turns out Xcode keeps copies of built frameworks and moving to swift3 is apparently not a cue to rebuild those (even after finding out it was built using swift2.... no let's throw a vague error instead...)
The solution is to delete the content of your 'derived data' folder.
Works for frameworks installed with Carthage and cocoapods.....
Related Topics
How to Highlight a Uitextview's Text Line by Line in Swift
How to Override Layerclass in Swift
Changing Tab Bar Font in Swift
Difference Between Switch Cases "@Unknown Default" and "Default" in Swift 5
Combining Two Conditions in Nspredicate
What Is Import Func, Struct, Class, and @_Exported in Swift
Collection View Cell Button Not Triggering Action
Swift Diffabledatasource Make Insert&Delete Instead of Reload
How to Prove "Copy-On-Write" on String Type in Swift
Sprite-Kit: Moving an Element in Circular Path
How to Set Title of Navigation Bar in Swift
Scene Kit Performance with Cube Test
Swift: How Can String.Join() Work Custom Types
Catch Objective-C Exception in Swift
Local Swift Packages Stopped Working in Xcode 13