问题描述:
- 使用iphone6p真机调试,编译正常
- 换成iPhone5真机调试,编译出现一堆错误:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20ld: warning: ld: warning: ignoring file /Users/lynn/Library/Developer/Xcode/DerivedData/Homecare-bcfxxolnwbuzthdgksefvehktwzf/Build/Products/Debug-iphoneos/libAFNetworking.a, file was built for archive which is not the architecture being linked (armv7): /Users/lynn/Library/Developer/Xcode/DerivedData/Homecare-bcfxxolnwbuzthdgksefvehktwzf/Build/Products/Debug-iphoneos/libAFNetworking.aignoring file /Users/lynn/Library/Developer/Xcode/DerivedData/Homecare-bcfxxolnwbuzthdgksefvehktwzf/Build/Products/Debug-iphoneos/libCocoaAsyncSocket.a, file was built for archive which is not the architecture being linked (armv7): /Users/lynn/Library/Developer/Xcode/DerivedData/Homecare-bcfxxolnwbuzthdgksefvehktwzf/Build/Products/Debug-iphoneos/libCocoaAsyncSocket.a
......
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_JTHorizontalCalendarView", referenced from:
type metadata accessor for __ObjC.JTHorizontalCalendarView in CalendarViewController.o
"_OBJC_CLASS_$_JTCalendarDayView", referenced from:
ZTE.CalendarViewController.calendar (__ObjC.JTCalendarManager!, prepareDayView : __ObjC.UIView!) -> () in CalendarViewController.o
ZTE.CalendarViewController.calendar (__ObjC.JTCalendarManager!, didTouchDayView : __ObjC.UIView!) -> () in CalendarViewController.o
"_OBJC_CLASS_$_MGSwipeTableCell", referenced from:
_OBJC_CLASS_$__TtC3ZTE15MessageItemView in MessageItemView.o
"_OBJC_CLASS_$_QNZone", referenced from:
type metadata accessor for __ObjC.QNZone in HCUploadManager.o
"_OBJC_CLASS_$_QNConfiguration", referenced from:
type metadata accessor for __ObjC.QNConfiguration in HCUploadManager.o
"_OBJC_CLASS_$_MJRefreshHeader", referenced from:
_OBJC_CLASS_$_HCRefresh in HCRefresh.o
"_OBJC_METACLASS_$_MJRefreshHeader", referenced from:
_OBJC_METACLASS_$_HCRefresh in HCRefresh.o
"_OBJC_CLASS_$_AFNetworkReachabilityManager", referenced from:
......
问题分析:
从日志上看,出问题的都是实用cocoapods安装的第三方库;从日志看,应该是没有编译armv7对应的内容,修改pods工程的配置:
buildsettings->build active architecture only属性,debug->NO, release->NO
我这样改后,还是报同样的错误;折腾了好久,最后进入pods编译出的静态库存在的目录,把所有第三方静态库全删了,重编一下就好了。