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

升级Flutter3.7后iOS构建失败:无法编译GTMSessionFetcher模块

Flutter 3.7升级后iOS构建失败:无法构建Objective-C模块'GTMSessionFetcher'

将项目升级至Flutter 3.7最新版本并完成所有依赖包更新后,Android端可正常构建,但iOS端构建失败,核心错误为无法构建Objective-C模块'GTMSessionFetcher',具体编译错误日志如下:

Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'GTMSessionFetcher.GTMSessionFetcherLogging':
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcherLogging.h:15:8


Swift Compiler Error (Xcode): Duplicate interface definition for class 'GTMSessionFetcherUserDefaultsFactory'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:419:0


Swift Compiler Error (Xcode): Redefinition of 'GTMSessionFetcherError'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:429:27


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherErrorDownloadFailed'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:430:2


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherErrorUploadChunkUnavailable'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:431:2


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherErrorBackgroundExpiration'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:432:2


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherErrorBackgroundFetchFailed'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:433:2


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherErrorInsecureRequest'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:434:2


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherErrorTaskCreationFailed'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:435:2


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherErrorUserCancelled'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:439:2


Swift Compiler Error (Xcode): Redefinition of 'GTMSessionFetcherStatus'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:442:27


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherStatusNotModified'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:444:2


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherStatusBadRequest'
/ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:445:2


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherStatusUnauthorized'
ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:446:2


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherStatusForbidden'
ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:447:2


Swift Compiler Error (Xcode): Redefinition of enumerator 'GTMSessionFetcherStatusPreconditionFailed'
ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:448:2


Swift Compiler Error (Xcode): Reference to 'GTMSessionFetcherServiceProtocol' is ambiguous
Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:676:37


Swift Compiler Error (Xcode): Unknown class name 'GTMSessionFetcherServiceProtocol'; did you mean 'GTMSessionFetcherService'?
Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:676:37


Swift Compiler Error (Xcode): Type argument 'GTMSessionFetcherService' must be a pointer (requires a '*')
ios/Pods/GTMSessionFetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:676:37


Swift Compiler Error (Xcode): Too many errors emitted, stopping now


Swift Compiler Error (Xcode): Could not build Objective-C module 'GTMSessionFetcher'

已尝试但无效的解决方案

  • 安装最新版本的GTMSessionFetcher库
  • 确保所有必要依赖已安装并更新至最新版本
  • 清理构建文件夹后重新构建
  • 更新Pods并执行pod install
  • 删除Derived Data文件夹后重新构建

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.01 14:25:23