Xcode 10 Beta 5 - Clang: Error: Linker Command Failed with Exit Code 1

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



Leave a reply



Submit