- 最新处理方案已经更新,可直接跳过到文章结尾查看处理方案!
- 新增脚本处理方案。
报错内容
library not found for -lstdc++.6.0.9
错误截图
这个错误原因是因为iOS12.0之后去掉了lstdc++.6.0.9.tbd动态库,如下图搜索便知:
iOS12.0中全部采用libc++代替lstdc++的动态库(如下图),具体原因可以参考:
http://www.cnblogs.com/wellbye/archive/2013/04/25/3039203.html
因为beta版本Xcode是无法打包上传appstore,所以肯定还是需要Xcode10+Xcode11并行使用,而且现在部分第三方SDK依旧要依赖于lstdc++.6.0.9.tbd动态库,如果对代码进行改动或者修改Xcode的配置,可能会造成其他问题,例如在Xcode10上再次运行的时候可能会出现报错等等。
所以最简单解决该问题的方法就是从Xcode10中找到动态库lstdc++.6.0.9.tbd文件copy到Xcode 11 beta下就可以完美解决问题。或者用古老的办法将iOS13的DeviceSupport文件copy到Xcode11.0下也可以完美解决Xcode11.0运行iOS13的问题。
解决方案
需要将文件复制到下述四个路径下,才能保证模拟器和真机均好用
Xcode10下:
1 | /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/ |
Xcode11-beta下:
主要是第一条```的路径发生了变更,Xcode10中是```../Developer/Library/..```,而Xcode11中是```.../Library/Developer/...``` 1
2
3
4
5
```
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
1 | ``` |
为了方便大家,在此提供lstdc++动态库文件下载和DeviceSupport下载 链接:
DeviceSupport(8.0-13.0beta) 所有版本
DeviceSupport:iOS 7.0 - iOS 12 beta1 所有版本
新增脚本处理方案:点击下载
1 | // install.sh:Xcode10.2.1及其以下 |
Info
- Github: https://github.com/EchoZuo
- jianshu: https://www.jianshu.com/u/3390ce71084e
- CSDN: https://blog.csdn.net/zuoqianheng
- Email: zuoqianheng@foxmail.com
- Telegram: @echozuo