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和百度地相簿到最新的版本後莫名好了。