Vyacheslav Vyacheslav - 2 months ago 23
iOS Question

CocoaPods libraries errors building for some iOS simulators

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.

Answer

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.