1、按开发的需要,升级了xcode版本,真机编译项目的时候发现提示错误信息:
(null): URGENT: all bitcode will be dropped because ‘xxxx’ was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.
因为我用了的是激光推送sdk,且问题指向确实属于是该sdk的静态库。结果发现激光官网并没有跟新新的版本兼容ios9,后来网上给出了另一个解决方案:
2、做网络请求的时候发生提示
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection
Google后查证,iOS9引入了新特性App Transport Security (ATS)。详情:App Transport Security (ATS)
新特性要求App内访问的网络必须使用HTTPS协议。
但是现在公司的项目使用的是HTTP协议,使用私有加密方式保证数据安全。现在也不能马上改成HTTPS协议传输。
最终找到以下解决办法:
1) 在Info.plist中添加NSAppTransportSecurity类型Dictionary。
2)在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES。
3、还有一个比较特别的错误:
Undefined symbols for architecture x86_64:
"_u_errorName", referenced from:
_rkl_NSExceptionForRegex in MOBFoundation
_rkl_userInfoDictionary in MOBFoundation
_cm_rkl_NSExceptionForRegex in AGCommon
_cm_rkl_userInfoDictionary in AGCommon
"_u_strlen", referenced from:
_rkl_userInfoDictionary in MOBFoundation
_cm_rkl_userInfoDictionary in AGCommon
"_uregex_appendReplacement", referenced from:
_rkl_replaceAll in MOBFoundation
_cm_rkl_replaceAll in AGCommon
"_uregex_appendTail", referenced from:
_rkl_replaceAll in MOBFoundation
_cm_rkl_replaceAll in AGCommon
"_uregex_clone", referenced from:
-[MOBFRKLBlockEnumerationHelper initWithRegex:options:string:range:error:] in MOBFoundation
-[CMRKLBlockEnumerationHelper initWithRegex:options:string:range:error:] in AGCommon
"_uregex_close", referenced from:
_rkl_clearCachedRegex in MOBFoundation
_cm_rkl_clearCachedRegex in AGCommon
"_uregex_end", referenced from:
_rkl_performRegexOp in MOBFoundation
_rkl_findRanges in MOBFoundation
_rkl_search in MOBFoundation
_cm_rkl_performRegexOp in AGCommon
_cm_rkl_findRanges in AGCommon
_cm_rkl_search in AGCommon
"_uregex_find", referenced from:
_rkl_search in MOBFoundation
_cm_rkl_search in AGCommon
"_uregex_findNext", referenced from:
_rkl_search in MOBFoundation
_rkl_replaceAll in MOBFoundation
_cm_rkl_search in AGCommon
_cm_rkl_replaceAll in AGCommon
"_uregex_groupCount", referenced from:
_rkl_getCachedRegex in MOBFoundation
_cm_rkl_getCachedRegex in AGCommon
"_uregex_open", referenced from:
_rkl_getCachedRegex in MOBFoundation
_cm_rkl_getCachedRegex in AGCommon
"_uregex_reset", referenced from:
_rkl_replaceAll in MOBFoundation
_cm_rkl_replaceAll in AGCommon
"_uregex_setText", referenced from:
-[MOBFRKLBlockEnumerationHelper initWithRegex:options:string:range:error:] in MOBFoundation
_rkl_performRegexOp in MOBFoundation
_rkl_clearCachedRegexSetTo in MOBFoundation
-[CMRKLBlockEnumerationHelper initWithRegex:options:string:range:error:] in AGCommon
_cm_rkl_performRegexOp in AGCommon
_cm_rkl_clearCachedRegexSetTo in AGCommon
"_uregex_start", referenced from:
_rkl_performRegexOp in MOBFoundation
_rkl_findRanges in MOBFoundation
_rkl_search in MOBFoundation
_cm_rkl_performRegexOp in AGCommon
_cm_rkl_findRanges in AGCommon
_cm_rkl_search in AGCommon
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解决方案是:
4. 十月十六日 发现了一些新问题,
<Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
<Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
<Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
出错原因:设置app的状态栏样式的使用使用了旧的方式,在info.plist里面设置了View controller-based status bar appearance为NO,默认为YES,一般式iOS6的时候使用这种方式,iOS7,8也兼容,但是到了iOS9就报了警告。
解决办法:
删除 原先的设置代码
/*
// ================
// 设置可修改状态栏色彩 首先要在plist 中添加key View controller-based status bar appearance 设置NO
// ================
// */
// [[UIApplication sharedApplication ] setStatusBarStyle:UIStatusBarStyleLightContent];
修改方式将View controller-based status bar appearance设置为YES,然后使用新的方式来实现状态栏的样式。
然后再AppDelegate.m 添加方法
-(UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleLightContent;
}
5.ios9 必须在 didFinishLaunchingWithOptions 结束之前设置rootViewController,否则会崩溃
6.Xcode7 感觉修改了东西 记得一定要先clean下,这个感觉坑比较大。有时候忘记了,一直纠结怎么效果没变。