升级到Xcode 11.4 beta后,我从Pods
子项目(特别是来自YYImage
和Branch
目标)收到了这些警告:
目标完整性:MobileCoreServices 已重命名。请改用 CoreServices。
目标完整性:不推荐使用 AssetsLibrary。考虑改为迁移到照片。
我有inhibit_all_warnings!
我的Podfile
,但它对那些没有影响。
有没有办法让这些警告静音,直到这些 pod 的创建者修复它们?
我注意到从Pods/Frameworks/iOS
项目导航组中手动删除这两个框架可以解决这些警告。由于两个框架都嵌入到 iOS 本身(不是应用程序包)中,因此删除它们在运行时没有任何影响。以下是如何在Podfile
安装后挂钩中自动执行此操作:
post_install do |installer|
installer.pods_project.frameworks_group["iOS"]["MobileCoreServices.framework"].remove_from_project
installer.pods_project.frameworks_group["iOS"]["AssetsLibrary.framework"].remove_from_project
end
如果这留下了悬挂(null)
参考,您可以执行以下操作:
post_install do |installer|
framework = installer.pods_project.frameworks_group["iOS"]["MobileCoreServices.framework"]
framework.referrers.each do |ref|
if ref.isa == "PBXBuildFile"
ref.remove_from_project
end
end
framework.remove_from_project
end
在 iOS/Podfile 中将平台:ios,“13.0”更改为平台:ios,“11.0”
对我来说就像一个魅力!