You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

添加FirebaseRemoteConfig后Xcode报'GoogleUtilities/GULNSDATA+zlib.h'文件未找到

解决Xcode中'GoogleUtilities/GULNSDATA+zlib.h'文件未找到问题(FirebaseRemoteConfig相关)

可能的原因与解决方案

1. 彻底清理Pod缓存并重装依赖

Pod缓存损坏是这类问题的常见诱因,执行以下步骤重置依赖:

  • 清除本地所有Pod缓存:pod cache clean --all
  • 删除项目目录下的Pods文件夹和Podfile.lock:
    rm -rf Pods/
    rm Podfile.lock
    
  • 重新安装依赖:pod install

2. 指定与Firebase兼容的GoogleUtilities版本

直接添加pod 'GoogleUtilities'可能拉取了和当前FirebaseRemoteConfig不兼容的版本,需要匹配版本号:

  • 查看Podfile.lock中Firebase相关组件的版本,找到对应的GoogleUtilities版本要求(比如Firebase 10.x版本通常需要GoogleUtilities 7.x以上)
  • 修改Podfile为指定版本,例如:pod 'GoogleUtilities', '~> 7.11',再执行pod install

3. 检查Xcode Build Settings配置

  • 打开项目Build Settings,搜索Header Search Paths,确保包含$(inherited)并设置为Recursive
  • 搜索Framework Search Paths,同样添加$(inherited)并设为Recursive
  • 执行Cmd+Shift+K清理Xcode缓存,重启Xcode后重新编译

4. 调整CocoaPods的模块化配置

部分项目的模块化头文件设置会导致头文件查找失败:

  • 在Podfile顶部添加:
    use_frameworks! :linkage => :static
    
    若为旧项目,也可尝试仅添加use_frameworks!,然后重新执行pod install

5. 完全移除Pod集成后重新配置

执行pod deintegrate彻底清除所有Pod相关的项目配置,再重新安装:

pod deintegrate
pod install

内容的提问来源于stack exchange,提问作者Karatekid430

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 07:55:33