苹果开发 笔记 80 升级IOS 9 和 XCode 7 引起的问题记录
分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.****.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
问题一: 升级xcode 7最低的系统配置要求
升级了ios9 后使用 xcode 6.1 已经不能用了,必须升级 xcode 7才行,原先的系统是OSX 10.10.1 版本。而xcode 7.0 系统最低的系统要求是os x 10.10.4 或者以上(官方表明)。这样子不用等到新的 mac 新系统 到来也可以提前用了。
问题二 :微信库64位的问题
xcode 7 的动态库后缀名改了,这下子旧的项目也要重新替换。
这里有一篇文章是关于ios 微信的用法和配置 可以参考一下
不过 64 位的问题 也随之而来,如果不加入 libc++.dylib 后就会报错 编译不过
所以在微信引入库里面,需要加入
libsqlite3.0.dylib
libz.dylib
SystemConfiguration.framework
libc++.dylib (如果编译错了,加上这个库进去。)
注意:xcode 7 变了后缀
问题3 ios 9 App Transport Security Policy (ATP的问题)
突然遇到这个问题是使用UIWebView加载 http 而不是https 协议的网址。
解决的方法可以参考这里 iOS9 HTTP 不能正常使用的解决办法
在Info.plist中添加NSAppTransportSecurity类型Dictionary。
在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES
注意一点当时直接修改info.list是没生效,参考网友的做法是在target 里面info 下再添加。这个时候生效了,能够处理这个问题。不知道原理是什么,这里的参数总是很让人莫名奇妙 但能凑效
问题 4 二进制库不支持bitcode
在 xcode 7 项目 中 build Settings 搜索这个字,默认情况是YES ,不支持就改成No 。
今天微信编译的时候也报相关的错,这一点真是让人纠结。xcode 设置总是多。有时候很难理解。只好一点点记录。
问题 5 Xcode process launch failed: Security
概述:之前一直是采用了企业的证书登录,所以编译过程中一直没有出现Xcode process launch failed: Security这样的问题。在xcode 7 配置好免证书进行调试,使用一个不是开发者的账号登录后会出现了这种问题。
参考的办法:stackoverflow Xcode process launch failed: Security
问题 6 出现了不受信任的开发者情况
概述:xcode 7 免证书下,需要使用自己的AppleID。我尝试打开编译后App**出现了不受信任的开发者情况**
解决办法:可以按如下操作 。以在真机ipad air 2 , ios 9 为例
中文版:设置-通用-描述文件 选择受信任的开发者
英文版:Go to your iPhone > Settings > General > Profile > “[email protected]” > Trust(引用stackoverflow 的一位解答)
设置后,这个问题可以解决了,然后可以继续玩耍。
问题 7 Xcode 插件Alcatraz 安装不显示Package manager
参考 https://github.com/supermarin/Alcatraz/issues/352
终端输入:defaults delete com.apple.dt.Xcode DVTPlugInManagerNonApplePlugIns-Xcode-7.0打开Xcode后有选项,选第一个Load
- 1
- 2
- 3
- 4
- 5
能凑效使用。
问题 8 部分API未来面临要修正
删除API这也不是苹果一两天的事情,刚接触API,发现了旧的书和新版本SDK已经不兼容了,刚在IOS使用UIAlertView,UIActionSheet 的时候,发现IOS的版本已经不存在了,到了IOS9 对这个组件已经不能再用了,改为合二为一UIAlertController 代替 。
NS_CLASS_DEPRECATED_IOS(2_0, 9_0, "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead")NS_CLASS_DEPRECATED_IOS(2_0, 8_3, "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead")
- 1
- 2
- 3
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"内容不能为空" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {}]; [alert addAction:defaultAction]; [self presentViewController:alert animated:YES completion:nil];
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
问题 9 约束框架和tableView 等在ios9问题引起注意
可以查阅以下文章进行解答。
https://github.com/ChenYilong/iOS9AdaptationTips
问题10 Cocoapods 升级系统后用不了,xcode插件路径引起问题
下面是关于在新版系统不能使用Cocopods 命令的问题,一些解决的方法。
http://stackoverflow.com/questions/32934911/cocoapods-doesnt-work-after-upgrading-mac-os-x-ei-capitain
https://github.com/kattrali/cocoapods-xcode-plugin/issues/76
新版系统会删除旧的Cocopods 改变了原先的位置,重装一下,改变一下ruby 淘宝镜像地址。重新安装后,xcode的Cocoapods 插件就能用得上了,注意区别 usr/bin usr/local/bin的位置
一次教训:将设备的 Show Provisioning Profiles 删除了
误操作: 把Show Provisioning Profiles 删除了
造成结果:之前的自己编译的应用全部打不开了。
操作如下 :
xcode - >window->Devices 打开后可以看到自己的机器(USB链接下)
点击设备,鼠标右键 看到Show Provisioning Profiles 的菜单,然后可以看到自己Identifer
使用“-”减号 删除。操作完成后,之前的编译过的App将不能启动了。真是算是一次教训吧
一些问题的解决参考资料如下:
《ios编译库文件时出现的问题》
http://www.jianshu.com/p/3f87f024b573
《does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE)》
http://www.swift7media.com/category/ios-development/
《开发中常见错误和警告总结(九)》
http://www.bubuko.com/infodetail-1061146.html
《二进制库不支持bitcode》
http://blog.****.net/soindy/article/details/48519363
《【官方方法】xcode7免证书真机调试》
(http://altair21.com/156.html)
《IOS 9 适配 问题》
https://github.com/ChenYilong/iOS9AdaptationTips
给我老师的人工智能教程打call!http://blog.****.net/jiangjunshow
问题一: 升级xcode 7最低的系统配置要求
升级了ios9 后使用 xcode 6.1 已经不能用了,必须升级 xcode 7才行,原先的系统是OSX 10.10.1 版本。而xcode 7.0 系统最低的系统要求是os x 10.10.4 或者以上(官方表明)。这样子不用等到新的 mac 新系统 到来也可以提前用了。
问题二 :微信库64位的问题
xcode 7 的动态库后缀名改了,这下子旧的项目也要重新替换。
这里有一篇文章是关于ios 微信的用法和配置 可以参考一下
不过 64 位的问题 也随之而来,如果不加入 libc++.dylib 后就会报错 编译不过
所以在微信引入库里面,需要加入
libsqlite3.0.dylib
libz.dylib
SystemConfiguration.framework
libc++.dylib (如果编译错了,加上这个库进去。)
注意:xcode 7 变了后缀
问题3 ios 9 App Transport Security Policy (ATP的问题)
突然遇到这个问题是使用UIWebView加载 http 而不是https 协议的网址。
解决的方法可以参考这里 iOS9 HTTP 不能正常使用的解决办法
在Info.plist中添加NSAppTransportSecurity类型Dictionary。
在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES
注意一点当时直接修改info.list是没生效,参考网友的做法是在target 里面info 下再添加。这个时候生效了,能够处理这个问题。不知道原理是什么,这里的参数总是很让人莫名奇妙 但能凑效
问题 4 二进制库不支持bitcode
在 xcode 7 项目 中 build Settings 搜索这个字,默认情况是YES ,不支持就改成No 。
今天微信编译的时候也报相关的错,这一点真是让人纠结。xcode 设置总是多。有时候很难理解。只好一点点记录。
问题 5 Xcode process launch failed: Security
概述:之前一直是采用了企业的证书登录,所以编译过程中一直没有出现Xcode process launch failed: Security这样的问题。在xcode 7 配置好免证书进行调试,使用一个不是开发者的账号登录后会出现了这种问题。
参考的办法:stackoverflow Xcode process launch failed: Security
问题 6 出现了不受信任的开发者情况
概述:xcode 7 免证书下,需要使用自己的AppleID。我尝试打开编译后App**出现了不受信任的开发者情况**
解决办法:可以按如下操作 。以在真机ipad air 2 , ios 9 为例
中文版:设置-通用-描述文件 选择受信任的开发者
英文版:Go to your iPhone > Settings > General > Profile > “[email protected]” > Trust(引用stackoverflow 的一位解答)
设置后,这个问题可以解决了,然后可以继续玩耍。
问题 7 Xcode 插件Alcatraz 安装不显示Package manager
参考 https://github.com/supermarin/Alcatraz/issues/352
终端输入:defaults delete com.apple.dt.Xcode DVTPlugInManagerNonApplePlugIns-Xcode-7.0打开Xcode后有选项,选第一个Load
- 1
- 2
- 3
- 4
- 5
能凑效使用。
问题 8 部分API未来面临要修正
删除API这也不是苹果一两天的事情,刚接触API,发现了旧的书和新版本SDK已经不兼容了,刚在IOS使用UIAlertView,UIActionSheet 的时候,发现IOS的版本已经不存在了,到了IOS9 对这个组件已经不能再用了,改为合二为一UIAlertController 代替 。
NS_CLASS_DEPRECATED_IOS(2_0, 9_0, "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead")NS_CLASS_DEPRECATED_IOS(2_0, 8_3, "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead")
- 1
- 2
- 3
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"内容不能为空" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {}]; [alert addAction:defaultAction]; [self presentViewController:alert animated:YES completion:nil];
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
问题 9 约束框架和tableView 等在ios9问题引起注意
可以查阅以下文章进行解答。
https://github.com/ChenYilong/iOS9AdaptationTips
问题10 Cocoapods 升级系统后用不了,xcode插件路径引起问题
下面是关于在新版系统不能使用Cocopods 命令的问题,一些解决的方法。
http://stackoverflow.com/questions/32934911/cocoapods-doesnt-work-after-upgrading-mac-os-x-ei-capitain
https://github.com/kattrali/cocoapods-xcode-plugin/issues/76
新版系统会删除旧的Cocopods 改变了原先的位置,重装一下,改变一下ruby 淘宝镜像地址。重新安装后,xcode的Cocoapods 插件就能用得上了,注意区别 usr/bin usr/local/bin的位置
一次教训:将设备的 Show Provisioning Profiles 删除了
误操作: 把Show Provisioning Profiles 删除了
造成结果:之前的自己编译的应用全部打不开了。
操作如下 :
xcode - >window->Devices 打开后可以看到自己的机器(USB链接下)
点击设备,鼠标右键 看到Show Provisioning Profiles 的菜单,然后可以看到自己Identifer
使用“-”减号 删除。操作完成后,之前的编译过的App将不能启动了。真是算是一次教训吧
一些问题的解决参考资料如下:
《ios编译库文件时出现的问题》
http://www.jianshu.com/p/3f87f024b573
《does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE)》
http://www.swift7media.com/category/ios-development/
《开发中常见错误和警告总结(九)》
http://www.bubuko.com/infodetail-1061146.html
《二进制库不支持bitcode》
http://blog.****.net/soindy/article/details/48519363
《【官方方法】xcode7免证书真机调试》
(http://altair21.com/156.html)
《IOS 9 适配 问题》
https://github.com/ChenYilong/iOS9AdaptationTips