标签:
前几天升级OS X EI Capitan 10.11.1, 以及Xcode7.1,正好赶上公司新产品上线,要做iOS9的适配,遇到各种坑,各种查资料,随之记录总结一下遇到的坑.
先说下要适配iOS9要做的事:
1.更改http为https
两种方案:
一.公司后台服务器更改;
二.作为开发者,可在Xcode暂时退回到http协议. 开发者更改方法如下:
1.在Info.plist中添加App Transport Security Settings (或NSAppTransportSecurity), 类型Dictionary。
2.在App Transport Security Settings下添加Allow Arbitrary Loads (或NSAllowsArbitraryLoads), 类型Boolean,值设为YES.
2.对于使用ShareSDK第三方登录或分享,对iOS9的适配
可参考官方文档详细介绍:http://wiki.mob.com/ios9-对sharesdk的影响(适配ios-9必读)
包括:https协议支持,关闭bitcode支持,添加Scheme白名单.
3.Xcode7报错:Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:]
从iOS9开始,Xcode7需要所有UIWindow在makeKeyAndVisible之前必须有一个rootViewController,否则报以上错误。
解决方案:
UIViewController *emptyView = [[UIViewController alloc] init];
self.window.rootViewController = emptyView;
[self.window makeKeyAndVisible];
4.Xcode7打开旧项目FrameWork文件夹下的.dylib库缺失,添加方法
项目Target中Link Binary With Libraries 点击下方 “+”添加, 显示搜索页面,在此搜.dylib搜不出来(只能搜到同名的.tbd), 需点击 Add Other,出现文件目录页面 (正常情况通过Finder同样找不到.dylib文件,因该文件是隐藏文件。需按快捷键 CMD+Shift+G,输入/usr/lib后进入隐藏界面,然后添加需要的.dylib即可。
5.Xcode7 真机测试,真机出现"unavailable"字样,Could not find developer disk image.
stackoverflower答案: 点击查看
解决方案:
先关闭Xcode.再从Xcode 6.4中,拷贝8.4 (12H141)文件夹到Xcode 7的对应目录下.
Xcode 6.4路径为:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Xcode 7路径为:
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
重新打开Xcode 7,打开项目,需要等一会,等到菊花不转了,才能运行。
6.App上传Appstore错误
7.App上传Appstore错误
“invalid package Applications built with SDK 9.0 or later must be packaged as proper IPA files.”
#!/bin/bash APPNAME="appName" ZIPNAME="zipName" IPANAME="ipaName" mkdir ./ipa/Payload cp -r ./${APPNAME}.app ./ipa/Payload cd ipa zip -r ${ZIPNAME} * mv ${ZIPNAME}.zip ${IPANAME}.ipa
8.App上传Appstore错误
ERROR ITMS-90535 Unexpected CFBundleExecutable Key.
解决方案:
-> 0x2be590cc <+0>: bx lr
在网上看到的答案:
选 Project,然后进 BuildPhases,然后进 LinkBinaryWithLibraries. 找到 GLKit.Framework ,把它的 status 更改为 optional 就 ok.(如果没有GLKit.Framework, 添加一个再设置)
因bug无法重现,无法验证以上方法是否可行.
<2>Xcode7.1真机测试启动崩溃,模拟器正常,添加Enable Address Sanitizer调试,崩溃在启动页.
暂时解决办法: 用Xcode 6.3.2运行打包即可.
libclang_rt.asan_ios_dynamic.dylib`__asan::AsanDie:
-> 0x5e8240 <+0>: push {r4, r5, r7, lr} //代码崩溃在此行
0x5e8242 <+2>: add r7, sp, #0x8
0x5e8244 <+4>: dmb ish
打印信息如下:
AddressSanitizer debugger support is active. Memory error breakpoint has been installed and you can now use the ‘memory history‘ command.
==891==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==891==ASan shadow was supposed to be located in the [0x3ffff000-0x5fffffff] range.
==891==Process memory map follows:
0x3af88000-0x3af89000 /usr/lib/libgcc_s.1.dylib
0x3da44000-0x434ec000 /usr/lib/libgcc_s.1.dylib
0x36556000-0x3655f000 /System/Library/PrivateFrameworks/MobileBluetooth.framework/MobileBluetooth
0x3cf7c000-0x3cf7d000 /System/Library/PrivateFrameworks/MobileBluetooth.framework/MobileBluetooth
0x3da44000-0x434ec000 /System/Library/PrivateFrameworks/MobileBluetooth.framework/MobileBluetooth
0x34a47000-0x34a4e000 /System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager
0x3c671000-0x3c673000 /System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager
0x3da44000-0x434ec000 /System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager
........省略中间部分
0x3b1a3000-0x3b2f5000 /usr/lib/libicucore.A.dylib
0x3d91a000-0x3d92c000 /usr/lib/libicucore.A.dylib
0x3da44000-0x434ec000 /usr/lib/libicucore.A.dylib
0x3b92b000-0x3b9c2000 /usr/lib/libsqlite3.dylib
0x3d977000-0x3d979000 /usr/lib/libsqlite3.dylib
0x3da44000-0x434ec000 /usr/lib/libsqlite3.dylib
0x005b0000-0x00604000 /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib
0x00604000-0x00a60000 /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib
0x00a60000-0x00aa0000 /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib
0x005ad000-0x005ae000 /Library/MobileSubstrate/MobileSubstrate.dylib
0x005ae000-0x005af000 /Library/MobileSubstrate/MobileSubstrate.dylib
0x005af000-0x005b0000 /Library/MobileSubstrate/MobileSubstrate.dylib
0x00010000-0x00014000 /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/wojsww
0x00014000-0x00370000 /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/wojsww
0x00370000-0x003f4000 /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/wojsww
0x003f4000-0x005ac000 /var/mobile/Applications/D0115D17-C682-41AD-8E5C-D9DA83CF1053/wojsww.app/wojsww
==891==End of process memory map.
AddressSanitizer report breakpoint hit. Use ‘thread info -s‘ to get extended information about the report.
菜鸟不知原因,望大神解答.
标签:
原文地址:http://www.cnblogs.com/znios/p/4917704.html