我的 flutter iOS 应用程序中的 sqlcipher.bundle (生成多个命令)有问题

问题描述 投票:0回答:1

所以我有一个 flutter 应用程序,当我在 iPhone 上调试它时,它工作得很好,但是当我尝试构建 ipa 文件时,它向我显示此错误:

这表明有多个命令正在尝试在同一位置生成具有相同名称的 SQLCipher.bundle 文件夹。正在尝试的两个是 FMDB 和 SQLCipher。它们都是生成的,因为我在我的 flutter 应用程序中使用 sqflite_sqlcipher: ^3.1.0+1。

显示最近的问题 多个命令生成 '/Users/user1/Library/Developer/Xcode/DerivedData/Runner-bgmcokivomqkibdepnikxaoitzbu/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SQLCipher.bundle'

显示最近的问题 目标“FMDB-SQLCipher”(项目“Pods”)已创建目录命令,输出为“/Users/user1/Library/Developer/Xcode/DerivedData/Runner-bgmcokivomqkibdepnikxaoitzbu/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/ iphoneos/SQLCipher.bundle'

显示最近的问题 目标“SQLCipher-SQLCipher”(项目“Pods”)已创建目录命令,输出为“/Users/user1/Library/Developer/Xcode/DerivedData/Runner-bgmcokivomqkibdepnikxaoitzbu/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/ iphoneos/SQLCipher.bundle'

我已经尝试了从 flutter clean、pub get 和升级到 pod deintegrate 和 pod install 的所有解决方案,例如编辑 podfile,但不幸的是没有任何效果。

因为 FMDB 和 SQLCipher 都是在提交 pod install 时自动生成的,所以 podfile.lock 中的任何更改都是无用的。

如果有人有解决方案,请帮忙。

flutter xcode ipa fmdb sqlcipher
1个回答
0
投票

我在包的 GitHub 页面上发现了解决此问题的有用解决方法。您可以将以下代码添加到您的

Podfile
来解决它:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'FMDB-SQLCipher'
      target.build_configurations.each do |config|
        config.build_settings['PRODUCT_NAME'] = 'FMDBSQLCipher'
      end
    end
    flutter_additional_ios_build_settings(target)
  end
end

此代码片段将

PRODUCT_NAME
更改为
FMDB-SQLCipher
目标,并为 iOS 应用额外的 Flutter 构建设置。有关更多详细信息,请查看包的 GitHub 问题页面上的讨论。

© www.soinside.com 2019 - 2024. All rights reserved.