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

执行pod install后部分Pods未下载,M1 Mac出现模块找不到错误

解决M1 MacBook上CocoaPods模块未下载的问题

第一步:彻底清理旧Pod文件

先移除可能存在的缓存或损坏文件:

  • 删除项目根目录下的 Pods 文件夹
  • 删除 Podfile.lock 文件
  • 删除项目对应的 .xcworkspace 文件

第二步:适配M1架构重新安装Pods

M1芯片的架构差异可能导致Pod安装异常,按以下步骤操作:

  1. 打开终端,切换到项目根目录
  2. 依次执行命令:
pod deintegrate
pod setup
pod install --repo-update

若上述命令无效,尝试用Rosetta模式打开终端后,执行:

arch -x86_64 pod install --repo-update

第三步:优化Podfile配置

你的Podfile存在两处重复的 use_frameworks!,且Firebase配置有冗余,建议调整后再重新安装:

# platform :ios, '9.0'
source 'https://cdn.cocoapods.org/'
target 'app' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for app
  pod 'Applio'
  pod 'SQLite.swift'
  pod 'JVFloatLabeledTextField'
  pod 'MaterialComponents/Snackbar'
  pod 'iOSDropDown'
  pod 'Firebase/Analytics'
  pod 'Firebase/Messaging'
  pod "BSImagePicker", "~> 3.1"
  pod "StompClientLib"
  
  pod 'SVProgressHUD', '~> 2.2.5'
  pod 'TPKeyboardAvoiding', '~> 1.3.5'
  pod 'RangeSeekSlider', '~> 1.8.0'
 
  pod 'SDWebImage', '~> 5.12.5'
  pod 'PureLayout', '~> 3.1.9'
  pod 'TagListView', :git => 'https://github.com/govindravaliya/TagListView.git', :branch => 'master'
  
  pod 'FirebaseAuth'
  pod 'GoogleSignIn'
  pod 'GooglePlaces'
  pod 'RealmSwift'
end

post_install do |installer|
  installer.generated_projects.each do |project|
        project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.1'
                xcconfig_path = config.base_configuration_reference.real_path
                xcconfig = File.read(xcconfig_path)
                xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
                File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
             end
        end
     end
end

第四步:Xcode配置检查

  1. 确保打开的是项目的 .xcworkspace 文件,而非 .xcodeproj
  2. 进入项目 Build Settings,确认 Framework Search Paths 包含 Pods/Frameworks 路径
  3. 执行 Cmd+Shift+K 清理Xcode缓存,重启Xcode后重新编译

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.29 03:11:16