今天碰到一个很奇怪的问题,XCODE提示这样的警告 Pods was rejected as an implicit dependency for ‘libPods.a’ because its architectures ‘i386’ didn’t contain all required architectures ‘x86_64’
在网上搜了一篇,解析是这样的,因为pod 是以ARM64 的编译打包的,而在我的项目中指定 valid Architectures 是armv7,所以就报上面的错误,表现是在工程中所引用 pod类找不到,
在网上有一种解决方法是去设置pod工程的 valid Architectures 与你的项目工程的 valid Architectures 一致。
注意:在每次Podfile更新之后,还需要重新检查新的Pods工程中的设置是不是如上面设置的一致,如果不一致,则需要修改一致。
另外一种方法是在podfile 文件中指定你的 valid Architectures 。
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ARCHS'] = "armv7"
end
end
end
在podfile 文件的结尾加上上面的代码,就可以搞定,且每次更新也有效。
本文介绍了在使用Xcode过程中遇到的Pods架构不匹配问题,表现为引用的Pod类无法找到。文章提供了两种解决方案:一是确保Pods项目的valid Architectures与主项目一致;二是通过在Podfile文件中设置ARCHS参数来解决此问题。
750

被折叠的 条评论
为什么被折叠?



