Swift中missing required architecture i386 in file錯誤的解決

來源:互聯網
上載者:User

1,問題描述

最近使用騰訊官方 SDK 進行開發,下載的是最新版本。所以東西都配置好後,編譯報錯。(只有在 iPhone5 及 iPhone4s 模擬器上編譯運行程式會有這個問題。)
報錯資訊如下:

ld: warning: ignoring file /Users/yuhang/Documents/Code/hangge_1070/TencentOpenAPI.framework/TencentOpenAPI, missing required architecture i386 in file /Users/yuhang/Documents/Code/hangge_1070/TencentOpenAPI.framework/TencentOpenAPI (3 slices)
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_TencentOAuth", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

2,原因分析

新版本的騰訊 SDK 的 CPU 架構不支援 i386 架構,而 iPhone5 及以下裝置的模擬器是 i386 架構,所以會 missing required architecture i386 in file。

3,解決辦法

改成使用 iPhone5s 及以上版本的模擬器編譯運行,或者直接使用 iPhone 真機。

 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.