问题(1)The file “Info.plist” couldn’t be opened because there is no such file
问题描述:修改了Info.plist的实际文件位置(项目和单元测试对应不同的Info.plist),导致程序运行时崩溃(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下有单元测试,设置单元测试target的info,与项目target同一个路径。BuildSetting下搜索info.plist File第二种情况:如果已经删除单元测试相关文件,则是删的不够彻底,把单元测试的target也删掉就OK了。project targets —— delete
问题(2)解决(iOS 10)调用系统蓝牙库出现程序奔溃问题
问题描述: 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'(手机端作为主设备时“cbcentralmanager“状态恢复只允许有特定的“蓝牙中央背景模式应用)
解决方案:在info.plist加Required background modes类型array在列表下添加App communicates using CoreBluetooth
问题(3)解决app内选取系统照片或拍照时崩溃问题(iOS 10)
问题描述: app设置用户头像时,访问系统图库或者拍照时程序崩溃
解决方案:,因为app试图访问系统隐私敏感的数据,需要在Info.plist下添加说明。在plist文件下添加Privacy - Camera Usage Description键与一个字符串值(访问相册),Privacy - Photo Library Usage Description键与一个字符串值(访问相机)
问题(4) app中使用UIImageView帧动画时占用内存很大
问题描述:图片数量较多的时候,加入播放数组中时,非常消耗内存
解决方案:使用imageNamed:这个方法加载完图片后,图片会驻留内存,坏处:占用内处,好处:调用速度很快
imageWithContentsOfFile:这个方法当图片用完后回释放内粗,好处:不占用内存,性能比较好,坏处:速度慢。
问题(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
解决方案:如果打包出现上述类似的错误,只需在build setting里搜索bitcode关闭即可。因为打包的第三方静态库不支持bitcode。
Bitcode是被编译程序的一种中间形式的代码。包含bitcode配置的程序将会在App store上被编译和链接。bitcode允许苹果在后期重新优化程序的二进制文件,而不需要重新提交一个新的版本到App store上。
问题(6) 模拟器调试时,偶尔出现网络无法访问报错
问题描述::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) 打包静态库报错
问题描述: framework生成后在项目中调用,连接iPhone6和iPhone7时可以成功调用,在连接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设置为YES,那么连接iPhone4的时候,就会以armv7打包;连接iPhone5S的时候,就会以arm64打包。如果Build Active Architecture Only设置为NO,那么就会2种架构都打,在运行期根据实际的设备架构来执行。所以最后打出来的Bundle体积会比较大,由于在编译算法库时,一般会连接某一型号手机,当连接iPhone7或iPhone6编译时编译出arm64平台的库,导致在iPhone5真机运行时找不到.o文件的问题,具体解决方案为在生成算法库时,选择Generic iOS Device
- armv7:对应iPhone4和iPhone4S
- armv7s:对应iPhone5和iPhone5C,还有早期的iPad
- arm64/armv8:对应iPhone5S和iPhone6以及iPhone7系列,
以及比较新的iPad,例如iPad mini2,iPad Air等
问题(8) 调用打包的静态库
问题描述: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
解决方案:在调用算法库的工程中,在Build Phases -> Embed Frameworks中添加此framework
还有一种可能是:库文件中的某些文件在你的项目中已经包含了,在Build Phases中将required改成optional即可
更多问题,将会持续更新…………