美文网首页iOS之报错上架填坑iOS搬砖
解决Xcode10 Library not loaded: /u

解决Xcode10 Library not loaded: /u

作者: 雨_田 | 来源:发表于2018-10-21 22:10 被阅读870次

由于Xcode10 废弃了libstdc++,库文件libstdc++.6.0.9. dylib、libstdc++.6. dylib、libstdc++. dylib、libstdc++.6.0.9.tbd、libstdc++.6.tbd、libstdc++.tbd也删除,所以在编译时某些模块会error或crash。
如:
dyld: Library not loaded: /usr/lib/libstdc++.6.dylib
Referenced from: /Users/xxh/Library/Developer/CoreSimulator/Devices/063C2EF2-5F01-4EC6-A34A-5E10EDF24C9E/data/Containers/Bundle/Application/B23D9872-61B0-4A7C-9FAA-0116FAC1563A/DYEngineer.app/DYEngineer
Reason: no suitable image found. Did find:
/usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator 等。

解决方案是从Xcode9的包中替换相应的文件。


库文件.png
-libstdc++.6.0.9.tbd
-libstdc++.6.tbd
-libstdc++.tbd
-libstdc++.6.0.9.dylib
-libstdc++.6.dylib
-libstdc++.dylib

写在前方 笔者建议:最好把缓存清除下再操作

一、Xcode10支持手机
方案:需要增加一个地址3个文件

地址1:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.6.0.9.tbd

二、Xcode10支持模拟器
方案:需要增加两个个地址3+3==6个文件

地址2:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libstdc++.6.0.9.dylib

地址3:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libstdc++.6.0.9.tbd

三、macOS开发需要再增加一个地址3个文件
地址4:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libstdc++.6.0.9.tbd

四、在Xcode7曾出现大规模病毒感染,而后苹果在Xcode8也封禁了插件,建议libstdc++文件从Xcode9中
--显示包内容获取。

相关文章

网友评论

  • 崭露头角:晓丽呀:+1:
    雨_田:@崭露头角 是只还是条:sunglasses:
    崭露头角:@雨_田 你猜?
    雨_田:@崭露头角 卧槽,你是哪个:joy:
  • 7cb993741a89:Xcode10支持模拟器这块,添加文件时/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/没有后面的文件夹了,直接添加吗?
    雨_田:@东方旭日_f3f4 模拟器的需要加连个地方的,都改了?
    7cb993741a89:@雨_田 添加后,重新跑的xcode模拟器仍然报错
    雨_田:@东方旭日_f3f4 右键显示包内容

本文标题:解决Xcode10 Library not loaded: /u

本文链接:https://www.haomeiwen.com/subject/aruizftx.html