Xcode11升级到Xcode12 遇到的问题

升级到Xcode12后报的错误如下:
  • 如果是三方库比如友盟推送出现了以前的SDK1.3.0版本,而现在是2.5.2版本,则在Build Setting中Library Search Paths中删除1.3.0版本
  • 重新选择New Build System,另一个弃用了


  • 模拟器报错,报错代码如下

ld: in /Users/mac126/Desktop/项目名/Pods/BaiduMapKit/BaiduMapKit/BaiduMapAPI_Base.framework/BaiduMapAPI_Base(BMSDKKeychainItemWrapper.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/mac126/Desktop/项目名/Pods/BaiduMapKit/BaiduMapKit/BaiduMapAPI_Base.framework/BaiduMapAPI_Base' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Xcode12 没有VALID_ARCHS,手动添加VALID_ARCHS,加一个x86_64

  • 真机运行报以下错

新加一个arm64 即可真机运行

但是加上x86_64后模拟器能运行,真机报错,加上x86_64和arm64后,真机能运行,模拟器报错。

所以不支持模拟器arm64架构,要排除arm64架构,解决如下:

Build Settings -> Excluded Architectures


以上配置完,真机和模拟器都能运行

  • ld: library not found for -lstdc++.6.0.9
    手动加入
将文件夹的内容拷贝到对应路径下即可

平台           文件夹              文件                大小                        路径
模拟器运行   CoreSimulator   libstdc++.6.0.9.dylib   766,624B        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/

模拟器编译   iPhoneSimulator libstdc++.6.0.9.tbd     206,800B        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

iOS真机       iPhoneOS       libstdc++.6.0.9.tbd    209,673B        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/

macAPP        MacOSX         libstdc++.6.0.9.tbd    206,751B        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/

模拟器运行和编译我把三个文件(libstdc++.6,libstdc++.6.0.9,libstdc++)全部加入,真机只加入6.0.9

6.0.9文件下载地址

链接: https://pan.baidu.com/s/1oDTkWi7htRgLY84mDis73Q
密码: 0d5g

参考文章一
参考文章二

你可能感兴趣的:(Xcode11升级到Xcode12 遇到的问题)