Xcode10再坑之framework not found CoreServices for architecture armv7

简介: 1、前言前段时间,升级了 Xcode10 后,提供给第三方用户的SDK,客户反馈说报错:ld: framework not found CoreServices for architecture armv7 为什么 iOS SDK 拖入项目中就报错"ld: framework not fou...

1、前言

前段时间,升级了 Xcode10 后,提供给第三方用户的SDK,客户反馈说报错:

ld: framework not found CoreServices for architecture armv7 

为什么 iOS SDK 拖入项目中就报错"ld: framework not found IOSurface for architecture arm64"?

其实,翻开之前写的文章已经说过解决方案: Xcode8报错:"Framework not found IOSurface for architecture arm64"或者 "Framework not found FileProvider for architecture x86_64/arm64". | iHTCboy's blog

当时,反复确认后,网上有些第三方的SDK提供商说升级 Xcode10 吧!!!慌张~ 你们就只能让别人升级啦!解决不了,重启,升级!但,NO,最后发现是新项目是使用 CocoaPods 导致的坑,一个地方进2次,还真不简单!

其中,看到有赞云这样说:

20190315-youzanyun-sdk.png

我只能说,坑的一个算一个,第三方用户就是这样,希望技术真的改变生活!包括技术的生活!

2、问题原因

因为我们新的项目使用 CocoaPods 组件化,所以最后打SDK的项目是CocoaPods集成的,问题就出在这里!上一个文章说到解决方法很简单:(Xcode8报错:"Framework not found IOSurface for architecture arm64"或者 "Framework not found FileProvider for architecture x86_64/arm64". | iHTCboy's blog

Build Settings 中 Link Frameworks Automatically 把默认Yes 改成 No

但是,如果用 CocoaPods 集成,默认是 Yes!!! 尼玛!!!

知道原因,解决就好办啦!但是,突然想到,以后 pod installpod update 时,难道要人工的设置一次??? 不可能!不可能!不可能!

最后,还是在 CocoaPods 官方文档找到答案 CocoaPods Guides - post_install

Podfile 文件最后,添加下面代码:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['CLANG_MODULES_AUTOLINK'] = 'NO'
        end
    end
end

这个是一个勾子hook,在pod安装完成前,允许更改配置或做些别的事件!

3、总结

这个问题,2次进坑,解决的问题本质就是一个,只是自己开始不相信!所以,遇到问题,还是要学会找到原因,只是通往答案的道路各不相同,只要不放弃,不抛弃,一定能为大家提供优质的服务!相信科技的力量!不然,只能让别人升级环境来适配你,这可不好哦!

参考


  • 如有疑问,欢迎在评论区一起讨论!
  • 如有不正确的地方,欢迎指导!


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


目录
相关文章
|
iOS开发
Xcode报错解决方法:ld: symbol(s) not found for architecture arm64
Xcode报错解决方法:ld: symbol(s) not found for architecture arm64
2591 0
|
12天前
|
iOS开发 Perl
Xcode 10.2.1 Error:library not found for -lstdc++.6.0.9
Xcode 10.2.1 Error:library not found for -lstdc++.6.0.9
17 0
|
Java iOS开发
Mac编译OpenJDK8:configure: error: Xcode 4 is required to build JDK 8, the version found was 10.1config
Mac编译OpenJDK8:configure: error: Xcode 4 is required to build JDK 8, the version found was 10.1config
96 0
|
iOS开发
未解决:configure: error: XCode tool ‘metal‘ neither found in path nor with xcrunchecking for metal...
未解决:configure: error: XCode tool ‘metal‘ neither found in path nor with xcrunchecking for metal...
130 0
Xcode12.x报错: ld: library not found for -lstdc++.6.0.9
错误信息: ld: library not found for -lstdc++.6.0.9 报错原因:Xcode10移除了动态库libstdc
244 0
|
iOS开发
Xcode 10: third-party: 'config.h' file not found
升级xcode到10版本之后 遇到 config.h 文件找不到的问题 In the Terminal, navigate to the react-native/third-party/glog folder inside node_modules...
1549 0
|
前端开发 iOS开发 移动开发
Xcode 10: Build input file double-conversion cannot be found
升级到xcode10之后 ReactNative项目启动报错如下: error: Build input file cannot be found: '/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.
3235 0
|
iOS开发
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下没有这个库。
1527 0