最近在测试出包中,所以一直没有机会将问题写下来。
我们用的Unity版本很老。Unity4.7,打包的时候发现XCODE10无法打包出来,编译过程中老是会出现头文件缺失的情况。查了很久才发现,原来XCode10和之前版本删了一个库libstdc++,这就很好的解释了为什么之前打包会出现各种各样的头文件缺失了。
我们后来用了XCode9.4 发现可以正常编译。这更进一步证实了那个错误。
但是随着测试机型越来越多,我们惊讶的发现,XCode9.4不支持目前所有的IOS设备的。尤其是苹果今年新推的几款产品,用了A12芯片,无法用老版本打包了。
所以添加libstdc++,就变成了燃眉之急。
以下的方法我亲身测试过。所以想要分享给大家。
如果大家有老版本的XCode的话可以直接去复制。如果大家不想下载的话,那就直接到我的资源去下载。https://download.csdn.net/download/u011625767/11072049
至于如何去下载老版本的XCode的话,苹果官网就可以下载了。
具体链接https://developer.apple.com/download/more
想要下载哪个下载哪个吧。
然后我们提供的资源有5个文件夹,大家挨个复制。就可以
将文件1内容添加到该路径中: (add the file 1 content into such path:)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/
将文件2内容添加到该路径中: (add the file 2 content into such path:)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
将文件3内容添加到该路径中: (add the file 3 content into such path:)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
将命名为include的文件合并替换为文件4内容: (merge such the file which named “include” with the file 4 content:)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include
将命名为include的文件合并替换为文件5内容: : (merge such the file which named “include” with the file 5 content:)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include