問題(1)The file “Info.plist” couldn’t be opened because there is no such file?
問題描述:修改了Info.plist的實際文件位置(項目和單元測試對應(yīng)不同的Info.plist),導(dǎo)致程序運行時崩潰(The solution for this particular instance of the error was “Info.plist couldn't be opened because there is no such file” was that I had deleted all of the files in the "Project Tests" folder, but was still had "Project Tests" listed under my targets. After deleting the "tests" target, the project built successfully.)
解決方案:第一種情況:targets下有單元測試,設(shè)置單元測試target的info,與項目target同一個路徑。BuildSetting下搜索info.plist File第二種情況:如果已經(jīng)刪除單元測試相關(guān)文件,則是刪的不夠徹底,把單元測試的target也刪掉就OK了。project targets —— delete?
問題(2)解決(iOS 10)調(diào)用系統(tǒng)藍(lán)牙庫出現(xiàn)程序奔潰問題
問題描述: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'State restoration of CBCentralManager is only allowed for applications that have specified the "bluetooth-central" background mode'(手機端作為主設(shè)備時“cbcentralmanager“狀態(tài)恢復(fù)只允許有特定的“藍(lán)牙中央背景模式應(yīng)用)
解決方案:在info.plist加Required background modes類型array在列表下添加App communicates using CoreBluetooth
問題(3)解決app內(nèi)選取系統(tǒng)照片或拍照時崩潰問題(iOS 10)
問題描述: app設(shè)置用戶頭像時,訪問系統(tǒng)圖庫或者拍照時程序崩潰
解決方案:,因為app試圖訪問系統(tǒng)隱私敏感的數(shù)據(jù),需要在Info.plist下添加說明。在plist文件下添加Privacy - Camera Usage Description鍵與一個字符串值(訪問相冊),Privacy - Photo Library Usage Description鍵與一個字符串值(訪問相機)
問題(4)?app中使用UIImageView幀動畫時占用內(nèi)存很大
問題描述:圖片數(shù)量較多的時候,加入播放數(shù)組中時,非常消耗內(nèi)存
解決方案:使用imageNamed:這個方法加載完圖片后,圖片會駐留內(nèi)存,壞處:占用內(nèi)處,好處:調(diào)用速度很快
imageWithContentsOfFile:這個方法當(dāng)圖片用完后回釋放內(nèi)粗,好處:不占用內(nèi)存,性能比較好,壞處:速度慢。
問題(5)?工程打包時報錯
問題描述:linker command failed with exit code 1 (use -v to see invocation)bitcode bundle could not be generated
‘FDAAlgorithm' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build for architecture arm64
解決方案:如果打包出現(xiàn)上述類似的錯誤,只需在build ?setting里搜索bitcode關(guān)閉即可。因為打包的第三方靜態(tài)庫不支持bitcode。
Bitcode是被編譯程序的一種中間形式的代碼。包含bitcode配置的程序?qū)贏pp store上被編譯和鏈接。bitcode允許蘋果在后期重新優(yōu)化程序的二進(jìn)制文件,而不需要重新提交一個新的版本到App store上。
問題(6)?模擬器調(diào)試時,偶爾出現(xiàn)網(wǎng)絡(luò)無法訪問報錯
問題描述::erro:Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSUnderlyingError=0x608000251280 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=54, _kCFStreamErrorDomainKey=1}}
解決方案:
一、Resetting content and settings of Simulator works. To reset the simulator follow the steps:
iOS Simulator -> Reset Content and Settings -> Press Reset (on the warning which will come)
二、退出模擬器,重新編譯
問題(7)?打包靜態(tài)庫報錯
問題描述: framework生成后在項目中調(diào)用,連接iPhone6和iPhone7時可以成功調(diào)用,在連接iPhone5時報錯,Undefined symbols for architecture armv7:
解決方案:具體編譯庫平臺說明見[鏈接](http://blog.csdn.net/kyfxbl/article/details/40117295),其中提到iPhone5編譯使用armv7s平臺,平臺向下兼容(armv7兼容armv7s和arm64),比如Architectures配置了armv7和arm64,Build Active Architecture Only設(shè)置為YES,那么連接iPhone4的時候,就會以armv7打包;連接iPhone5S的時候,就會以arm64打包。如果Build Active Architecture Only設(shè)置為NO,那么就會2種架構(gòu)都打,在運行期根據(jù)實際的設(shè)備架構(gòu)來執(zhí)行。所以最后打出來的Bundle體積會比較大,由于在編譯算法庫時,一般會連接某一型號手機,當(dāng)連接iPhone7或iPhone6編譯時編譯出arm64平臺的庫,導(dǎo)致在iPhone5真機運行時找不到.o文件的問題,具體解決方案為在生成算法庫時,選擇Generic iOS Device?
- armv7:對應(yīng)iPhone4和iPhone4S
- armv7s:對應(yīng)iPhone5和iPhone5C,還有早期的iPad
- arm64/armv8:對應(yīng)iPhone5S和iPhone6以及iPhone7系列,
以及比較新的iPad,例如iPad mini2,iPad Air等
問題(8)?調(diào)用打包的靜態(tài)庫
問題描述:dyld: Library not loaded: @rpath/FDAAlgorithm.framework/FDAAlgorithm
Referenced from: /var/containers/Bundle/Application/4B5A66B9-65B4-4BC5-8646-368644C6F61E/FDASystem.app/FDASystem
Reason: image not found
解決方案:在調(diào)用算法庫的工程中,在Build Phases -> Embed Frameworks中添加此framework?
還有一種可能是:庫文件中的某些文件在你的項目中已經(jīng)包含了,在Build Phases中將required改成optional即可
更多問題,將會持續(xù)更新…………