短错误:
file was built for archive which is not the architecture being linked (i386)
扩展:
对于某些模拟器,我在构建项目时收到这些错误:
ld:警告:忽略文件 /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libFSCalendar.a, 文件是为存档而构建的,而不是链接的体系结构 (I386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libFSCalendar.a ld:警告:忽略文件 /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libGBDeviceInfo.a, 文件是为存档而构建的,而不是链接的体系结构 (I386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libGBDeviceInfo.a ld:警告:忽略文件 /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSCLAlertView-Objective-C.a, 文件是为存档而构建的,而不是链接的体系结构 (I386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSCLAlertView-Objective-C.a ld:警告:忽略文件 /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSSKeychain.a, 文件是为存档而构建的,而不是链接的体系结构 (I386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSSKeychain.a 架构i386的未定义符号:"" _OBJC_CLASS _ $ _ FSCalendar", 引自: VCalendarView.o中的objc-class-ref" _OBJC_CLASS _ $ _ GBDeviceInfo",引自: VEMailView.o中的objc-class-ref DataClass.o中的objc-class-ref" _OBJC_CLASS _ $ _ SCLAlertView",引自: VAlerts.o中的objc-class-ref" _OBJC_CLASS _ $ _ SCLAlertViewBuilder",引自: VAlerts.o中的objc-class-ref" _OBJC_CLASS _ $ _ SCLAlertViewShowBuilder",引自: VAlerts.o中的objc-class-ref" _OBJC_CLASS _ $ _ SSKeychain",引自: VDescriptionView.o中的objc-class-ref ld:未找到架构i386 clang的符号:错误:链接器命令失败,退出代码为1 (使用-v查看调用)
适用于iPhone 6 Plus模拟器9.3.0,但适用于iPhone 5s。为什么?我有{{>>其他链接标记选项{。}}。
答案 0 :(得分:4)
我通过删除DerivedData
目录解决了这个问题。
步骤:
在Xcode中,转到菜单栏→窗口→项目。
在 Projects 窗口中,选择左侧的项目。
点击派生数据的删除... 按钮。当要求确认时,请单击删除。
重建项目。
对于Xcode 8,请参阅此Q&答:
How to delete derived data in Xcode 8?
答案 1 :(得分:0)
我找到了解决方案。
我删除了目录
/Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build
(右键单击CocoaPods库>在Finder中显示,然后找到其父目录)并重新进行全部重建。 Xcode重新创建了所有可以正常工作的库。所有构建首选项都与默认首选项相同。