Xcode8报错:**Framework not found IOSurface for architecture arm64** 或者 **Framework not found FilePr...

Xcode8 编译报错:

Framework not found IOSurface for architecture arm64
或者
Framework not found FileProvider for architecture x86_64/arm64.

原因

IOSurface.framework和 FileProvider.framework是 iOS11 新增加的库,但 Xcode8下没有这个库。打包静态库的时候,有一个Link Frameworks Automatically设置,默认为YES,会自动链接框架。所以Xcode 9打包的静态库时,在Xcode 8项目编译时候会提示找不到 IOSurface.framework和 FileProvider.framework。

题外话,这个在 Xcode5 和 Xcode6 过度时,Metal.framework 时发生过,可能过了就忘记了。也发现 Xcode 很多特性平时没有注意,有空真要多看看 LLVM 的知识。

结果

如果升级到 Xcode9,则不受影响。如果 Xcode8 编译报错,网上最初给出的方案,在 Xcode8 中添加IOSurface.framework和 FileProvider.framework后打包,结果最后还是会被坑哦!

在 Xcode8 中添加IOSurface.framework和 FileProvider.framework后打包,上传iTunes Connet 报错:

《Xcode8报错:**Framework not found IOSurface for architecture arm64** 或者 **Framework not found FilePr...》 iTunes Connet 报错使用非法 API.jpg

正确解决方案

Build Settings 中 Link Frameworks Automatically 把默认Yes 改成 No ,重新打Framework或.a文件,添加到 Xcode8 编译就能通过。

《Xcode8报错:**Framework not found IOSurface for architecture arm64** 或者 **Framework not found FilePr...》 设置 Link Frameworks Automatically 为 NO.jpeg

参考&扩展阅读

注:本文首发于 iHTCboy’s blog,如若转载,请注明来源。

点赞