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

Xcode中FIRConfiguration类重复定义错误及相关问题求助

iOS项目编译错误解决方案

问题背景

项目最低部署版本为iOS 14,CocoPods已更新至最新版,仍出现编译错误。相关信息如下:

错误截图

当前Podfile内容

#Uncomment the next line to define a global platform for your project
#platform :iOS, '14.0'
target 'Chall Champ' do use_frameworks!
pod ‘Appirater’
pod ‘Firebase/Core’
pod ‘Firebase/Auth’
pod ‘Firebase/Database’
pod ‘Firebase/Analytics’
pod ‘Firebase/Crashlytics’
pod ‘Firebase/Storage’
end

解决步骤

1. 修正Podfile配置

  • 取消注释platform :iOS, '14.0',确保Pods的部署版本与项目一致,避免版本冲突
  • 将Podfile中的中文全角引号‘’替换为英文半角引号'',否则CocoPods会解析失败
    修正后的Podfile:
platform :iOS, '14.0'
target 'Chall Champ' do 
  use_frameworks!
  pod 'Appirater'
  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  pod 'Firebase/Analytics'
  pod 'Firebase/Crashlytics'
  pod 'Firebase/Storage'
end

2. 彻底重置Pods环境

在项目根目录执行以下命令:

pod deintegrate
rm -rf Podfile.lock
pod install

3. 修复Appirater兼容性问题

从截图看,Appirater使用了iOS 14已废弃的API(如UIAlertView),处理方式:

  • 执行pod update Appirater升级到最新版本,确认是否已修复兼容性问题
  • 若无更新,手动修改Appirater源码:将UIAlertView替换为UIAlertController,移除applicationWillTerminate:中的过时调用

4. 统一项目部署目标

  • 打开Xcode,选中主项目Target,确认Deployment Info中的iOS Deployment Target为14.0
  • 进入Pods项目,检查所有子Target的部署目标,确保与主项目一致

内容的提问来源于stack exchange,提问作者Marcus Hauen-Limkilde

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.17 20:03:20