You need to enable JavaScript to run this app. M1 MacBook运行flutter build ios报AMSupportURLConnectionDelegate类重复实现错误
优惠活动
大模型
产品
解决方案
定价
更多

M1 MacBook运行flutter build ios报AMSupportURLConnectionDelegate类重复实现错误

问题定位

你看到的Class AMSupportURLConnectionDelegate is implemented in both相关两行输出仅为系统级符号冲突警告,本身不会直接触发构建失败。你需要优先排查这两行日志前后的其他明确报错信息,常见的真实错误原因包括签名配置错误、第三方依赖库架构不兼容、Flutter与Xcode版本不匹配等。

解决步骤

按优先级依次尝试以下操作:

  • 校正Xcode命令行工具配置
    执行xcode-select -p检查输出路径,若输出为/Library/Developer/CommandLineTools,执行以下命令切换为Xcode自带的命令行工具,执行完成后重启终端:
    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    
  • 清理项目缓存并重建依赖
    在项目根目录按顺序执行以下命令:
    flutter clean
    rm -rf ios/Pods ios/Podfile.lock
    flutter pub get
    cd ios && pod install --repo-update
    cd ..
    
    完成后重试flutter build ios。
  • 适配M1芯片架构兼容规则
    打开项目ios目录下的Podfile,在末尾的post_install代码块中补充架构配置,修改后内容如下:
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        flutter_additional_ios_build_settings(target)
        # 新增以下兼容配置
        target.build_configurations.each do |config|
          config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
          config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
        end
      end
    end
    
    修改完成后回到ios目录执行pod install,再重试构建。
  • Rosetta模式运行终端
    右键终端应用,点击「显示简介」,勾选「使用Rosetta打开」,重启终端后重新执行构建命令。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.15 02:54:02