Xcode 10.1 运行老版本工程遇到问题解决记录
近来接手公司一个历史遗留项目进行修改、上线工作,想想我都近三年没敲过iOS代码了也是慌。。
项目大致情况:
18年年初应上线项目,各种情况下一直搁置,到18年底了要重启上线,原来开发人员离职了都,年底开发人员工作也都各种忙的。。 于是,PM角色被拉来兜底0.0 闲扯一段,以下运行工程过程中遇到的问题和解决:
1 Showing Recent Messages
:-1: No signing certificate "iOS Distribution" found: No "iOS Distribution" signing certificate matching team ID "GHQ92T59ZR" with a private key was found. (in target 'JiFenTongJia’)
原因:搁置长时间,证书都过期失效了。
解决:重新配置好证书和Profile文件;
2 Showing Recent Messages
:-1: Multiple commands produce '/Users/fermin/Library/Developer/Xcode/DerivedData/JiFenTongJia-aeqilvnupcyphqfrdualufdecdmd/Build/Products/Debug-iphoneos/JiFenTongJia.app/Info.plist':
1) Target 'JiFenTongJia' (project 'JiFenTongJia') has copy command from '/Users/fermin/Documents/SourceTree/JiFenTongJia-iOS/JiFenTongJia/JiFenTongJia/External/Library/FSCalendar/Info.plist' to '/Users/fermin/Library/Developer/Xcode/DerivedData/JiFenTongJia-aeqilvnupcyphqfrdualufdecdmd/Build/Products/Debug-iphoneos/JiFenTongJia.app/Info.plist'
2) Target 'JiFenTongJia' (project 'JiFenTongJia') has copy command from '/Users/fermin/Documents/SourceTree/JiFenTongJia-iOS/JiFenTongJia/JiFenTongJia/External/Library/MGSwipeTableCell/Info.plist' to '/Users/fermin/Library/Developer/Xcode/DerivedData/JiFenTongJia-aeqilvnupcyphqfrdualufdecdmd/Build/Products/Debug-iphoneos/JiFenTongJia.app/Info.plist'
3) Target 'JiFenTongJia' (project 'JiFenTongJia') has process command with output '/Users/fermin/Library/Developer/Xcode/DerivedData/JiFenTongJia-aeqilvnupcyphqfrdualufdecdmd/Build/Products/Debug-iphoneos/JiFenTongJia.app/Info.plist’
原因:工程引用了包含第三方库在内的多个Info.plist文件;
解决:前往Target->Build Phases->Copy Bundle Resources中,删除系统Info.plist以外同名文件引用;
3 Provisioning profile "HBJX_Dev" doesn't include signing certificate "iPhone Distribution: Hangzhou Yaxin Enterprise Management Consulting Co., Ltd. (Q4K7PYSVSR)”.
原因:未深究,大概也是Profile证书未对应吧;
解决办法:https://blog.csdn.net/quantum7/article/details/80641630
Build Settings—>Code Signing Identity—>分别改为iOS Developer/iOS Distribution即可。
此时,真机可以跑了,但是模拟器上仍然报错;
4 ld: warning: directory not found for option '-L/Users/fermin/Documents/SourceTree/JiFenTongJia-iOS/JiFenTongJia/JiFenTongJia/External/Library/jpush-ios-3.0.8’
原因:之前开发应该更新过第三方库版本(原先版本库已删除),但是引用仍在;
解决办法:前往Target->Build Settings->Library Search Paths中,删除该引用;
5 ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/lib/libstdc++.6.0.9.tbd, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/lib/libstdc++.6.0.9.tbd (3 slices)
没找到解决办法,反正在模拟器中一直不行但是在真机上可以运行,于是不管,先改完要改的再说; 后面更新了CocoaPods和百度地图库到最新的版本后莫名好了。