iOS开发-pod删除库后终端警告[!] The `xxxx [
2022-02-16 本文已影响0人
俺不是大佬儿
近日为减小安装包体积清除pod库,无意中发现,通过终端执行 “pod install”
命令后发现报以下的警告:
终端警告
[!] The `ZGWSteelNetBiz [Debug]` target overrides the `EXCLUDED_ARCHS[sdk=iphonesimulator*]` build setting defined in `Pods/Target Support Files/Pods-ZGWSteelNetBiz/Pods-ZGWSteelNetBiz.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `ZGWSteelNetBiz [Release]` target overrides the `EXCLUDED_ARCHS[sdk=iphonesimulator*]` build setting defined in `Pods/Target Support Files/Pods-ZGWSteelNetBiz/Pods-ZGWSteelNetBiz.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
第一眼看见还是有点儿萌币的
等回过头在模拟器release模式下运行项目的时候发现Xcode报了个错,瞬间就和终端的警告呼应上了
Xcode报了个错/Users/lirongsheng/Desktop/xxxxAPP备份/xxxx/xxxx.xcodeproj The linked framework 'iflyMSC.framework' is missing one or more architectures required by this target: i386.
尝试解决报错时竟然是提示你更改项目支持的最小系统版本
提示将项目支持的最小版本改到iOS12当然不可能随了Xcode,毕竟辛辛苦苦适配的版本系统
继续盘解决问题:
第一步去除终端警告:
在Targets → Build Settings → Excluded Architecture中Debug和Release后面值增加 $(inherited)
,就可以去除pod install的警告
第二步解决Xcode报错 (每一步都重新运行下解决问题就好,不用都招呼上了)
:
1.Targets → Build Settings → Excluded Architecture中Debug和Release添加 Any iOS Simulator SDK
属性,添加值 arm64
并设置Targets → Build Settings → Active Architecture都为YES;
2.Podfile文件添加设置,在指定source源后面(target前添加)添加
:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end