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

Flutter iOS打包IPA遇SQLCipher.bundle多命令冲突问题求助

解决sqflite_sqlcipher打包IPA时SQLCipher.bundle冲突问题

以下是针对你遇到的FMDB-SQLCipher与SQLCipher-SQLCipher生成同名bundle冲突的可行解决方案:

方案1:通过Podfile钩子移除重复资源

在项目的ios/Podfile末尾添加post_install脚本,自动清理其中一个目标的冲突bundle资源:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'FMDB-SQLCipher'
      target.resources_build_phase.files.each do |file|
        target.resources_build_phase.remove_file(file) if file.file_ref.name == 'SQLCipher.bundle'
      end
    end
  end
end

执行cd ios && pod install,之后重新尝试打包。

方案2:强制统一依赖版本

在ios/Podfile中直接指定SQLCipher和FMDB的版本,避免依赖链中出现重复引入:

pod 'SQLCipher', '~> 4.5.5'
pod 'FMDB/SQLCipher', '~> 2.7.5'

执行cd ios && pod install --repo-update,确保依赖版本一致后再打包。

方案3:手动修改Xcode项目配置

  1. 打开ios/Runner.xcworkspace
  2. 找到Pods项目下的FMDB-SQLCipher和SQLCipher-SQLCipher两个Target
  3. 分别进入Build Phases -> Copy Bundle Resources
  4. 删除其中一个Target下的SQLCipher.bundle条目(推荐删除FMDB-SQLCipher下的)
  5. 执行Xcode的清理操作(Cmd+Shift+K),重新打包

方案4:升级依赖到最新版本

尝试升级sqflite_sqlcipher到最新版,官方可能已修复该冲突:

flutter pub upgrade sqflite_sqlcipher

之后依次执行flutter clean、cd ios && pod deintegrate、pod install,再尝试打包。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.18 10:43:14