2
votes

Short error:

file was built for archive which is not the architecture being linked (i386)

Expanded:
For some simulators, I receive these errors when building my project:

ld: warning: ignoring file /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libFSCalendar.a, file was built for archive which is not the architecture being linked (i386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libFSCalendar.a ld: warning: ignoring file /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libGBDeviceInfo.a, file was built for archive which is not the architecture being linked (i386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libGBDeviceInfo.a ld: warning: ignoring file /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSCLAlertView-Objective-C.a, file was built for archive which is not the architecture being linked (i386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSCLAlertView-Objective-C.a ld: warning: ignoring file /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSSKeychain.a, file was built for archive which is not the architecture being linked (i386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSSKeychain.a Undefined symbols for architecture i386: "_OBJC_CLASS_$_FSCalendar", referenced from: objc-class-ref in VCalendarView.o "_OBJC_CLASS_$_GBDeviceInfo", referenced from: objc-class-ref in VEMailView.o objc-class-ref in DataClass.o "_OBJC_CLASS_$_SCLAlertView", referenced from: objc-class-ref in VAlerts.o "_OBJC_CLASS_$_SCLAlertViewBuilder", referenced from: objc-class-ref in VAlerts.o "_OBJC_CLASS_$_SCLAlertViewShowBuilder", referenced from: objc-class-ref in VAlerts.o "_OBJC_CLASS_$_SSKeychain", referenced from: objc-class-ref in VDescriptionView.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

It works for, say, iPhone 6 Plus simulator 9.3.0 but not for iPhone 5s. Why? I have got $(inherited) for the Other Linker Flags option.

2

2 Answers

4
votes

I solved it by deleting the DerivedData directory.

Steps:

  1. In Xcode, go to Menu barWindowProjects.

  2. In the Projects window, choose the project on the left.

  3. Click the Delete... button for Derived Data. When asked to confirm, click Delete.

  4. Rebuild the project.


For Xcode 8, see this Q & A:
How to delete derived data in Xcode 8?

0
votes

I found the solution.

I removed the directory /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build (right click on the library of CocoaPods > Show in Finder, then find its parent directory) and rebuild all again. Xcode recreated all libraries which works right now. All build preferences are the same as default.