升级项目 swift:2.3 -> 3.2

19 篇文章 0 订阅

shopins從 swift2.3升級到 Xcode9可以泡的 swift3.2步驟:

1.用Xcode8.3.3打开2.3版本,此时会提示转换 swift 版本,在弹出的面板中选择自己文件的代码,也就是不要選擇第三方的,其他的轉換成swift3的版本,不能自動轉換的就接著進行餘下代碼的轉換工作

2.移除Plugins,將相關代碼全部移除

3.用pod升級所用第三方庫 :升級到3.2版本

4.pod 升級完畢後,在 Edit 中選擇轉換第三方的Swift版本,轉換完成後(主要是第三方的轉換),不要 save代码,選擇 cancel,即不要自動轉換的代碼(不要更改第三方代碼),此時在 Xcode8.3.3運行會報錯,直接關閉Xcode

5. 關閉8.3.3,用 Xcode9打開項目 ,可以正常运行。





出现错误:

A:Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_GTMLogger", referenced from: 
objc-class-ref in FirebaseMessaging(GIPReachability_d54098c5c1e1fdc4fca31a4803478650.o) 
ld: symbol(s) not found for architecture arm64 
clang: error: linker command failed with exit code 1 (use -v to see invocation)

B:.int32value

C:Xcode9 中 CryptoSwift代码错误
 代码报错
解决:
A:直接pod安装 'Firebase/Messaging'
B: huan'chengintvalue
C:版本换到0.7.0,然后用 Xcode8转换到版本 swift3(不要 save,就是转换后,弹出来的面板不要选择更改代码)
 

升级3.2后运行项目发现加密不一致問題:
加密字符串出現問題

:let tmp_data = "\(json_str!)\(sha256_key!)".data(using: .utf8)

sha256_key一定要加!,否則因為可選,導致不一樣(2.3没有这个问题)。



出现错误:

A:Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_GTMLogger", referenced from: 
objc-class-ref in FirebaseMessaging(GIPReachability_d54098c5c1e1fdc4fca31a4803478650.o) 
ld: symbol(s) not found for architecture arm64 
clang: error: linker command failed with exit code 1 (use -v to see invocation)

B:.int32value


C:Xcode9 中 CryptoSwift代码错误
 代码报错
解决:
A:'Firebase/Messaging'
B: intvalue
C:版本换到0.7.0,然后用 Xcode8转换到版本 swift3(不要 save,就是转换后,弹出来的面板不要选择更改代码)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
接着分析 (result (type_ident (component id='Bool' bind=Swift.(file).Bool))) (brace_stmt range=[re.swift:1:59 - line:14:1] (pattern_binding_decl range=[re.swift:2:5 - line:2:33] (pattern_named type='[UInt8]' 'b') Original init: (call_expr type='[UInt8]' location=re.swift:2:19 range=[re.swift:2:13 - line:2:33] nothrow (constructor_ref_call_expr type='(String.UTF8View) -> [UInt8]' location=re.swift:2:19 range=[re.swift:2:13 - line:2:19] nothrow (declref_expr implicit type='(Array<UInt8>.Type) -> (String.UTF8View) -> Array<UInt8>' location=re.swift:2:19 range=[re.swift:2:19 - line:2:19] decl=Swift.(file).Array extension.init(_:) [with (substitution_map generic_signature=<Element, S where Element == S.Element, S : Sequence> (substitution Element -> UInt8) (substitution S -> String.UTF8View))] function_ref=single) (argument_list implicit (argument (type_expr type='[UInt8].Type' location=re.swift:2:13 range=[re.swift:2:13 - line:2:19] typerepr='[UInt8]')) )) (argument_list (argument (member_ref_expr type='String.UTF8View' location=re.swift:2:29 range=[re.swift:2:21 - line:2:29] decl=Swift.(file).String extension.utf8 (declref_expr type='String' location=re.swift:2:21 range=[re.swift:2:21 - line:2:21] decl=re.(file).check(_:_:).encoded@re.swift:1:14 function_ref=unapplied))) )) Processed init: (call_expr type='[UInt8]' location=re.swift:2:19 range=[re.swift:2:13 - line:2:33] nothrow (constructor_ref_call_expr type='(String.UTF8View) -> [UInt8]' location=re.swift:2:19 range=[re.swift:2:13 - line:2:19] nothrow (declref_expr implicit type='(Array<UInt8>.Type) -> (String.UTF8View) -> Array<UInt8>' location=re.swift:2:19 range=[re.swift:2:19 - line:2:19] decl=Swift.(file).Array extension.init(_:) [with (substitution_map generic_signature=<Element, S where Element == S.Element, S : Sequence> (substitution Element -> UInt8) (substitution S -> String.UTF8View))] function_ref=single) (argument_list implicit (argument (type_expr type='[UInt8].Type' location=re.swift:2:13 range=[re.swift:2:13 - line:2:19] typerepr='[UInt8]')) )) (argument_list (argument (member_ref_expr type='String.UTF8View' location=re.swift:2:29 range=[re.swift:2:21 - line:2:29] decl=Swift.(file).String extension.utf8 (declref_expr type='String' location=re.swift:2:21 range=[re.swift:2:21 - line:2:21] decl=re.(file).check(_:_:).encoded@re.swift:1:14 function_ref=unapplied))) ))) (var_decl range=[re.swift:2:9 - line:2:9] "b" type='[UInt8]' interface type='[UInt8]' access=private readImpl=stored writeImpl=stored readWriteImpl=stored)
最新发布
06-10

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值