【问题标题】:Failed CryptoSwift Lib installation for Swift 4.0Swift 4.0 的 CryptoSwift Lib 安装失败
【发布时间】:2018-04-12 06:45:20
【问题描述】:

我想通过 CryptoSwift 库使用 AES 加密/解密。 我使用了一个使用 pod 的库。我使用的以下吊舱。 pod 'CryptoSwift', :git => "https://github.com/krzyzanowskim/CryptoSwift", :branch => "master" 在我编译项目时在项目中安装 pod 后,它给出了许多错误。

【问题讨论】:

  • 你能不能只用 pod 'CryptoSwift' 试试
  • 是的,我也尝试过,但没有成功
  • 什么是swift版本?
  • 我用的是 swift 4.0 和 xcode9.2
  • 它应该可以工作,因为它在这里工作

标签: ios swift encryption cryptography aes


【解决方案1】:
CocoaPods could not find compatible versions for pod "CryptoSwift":

请找到以下错误,我在尝试在您的项目中安装 pod 时看到。

我在您的演示项目中pod install 时发现了这个错误。

解决方案

从您的 podfile 中删除 pod 'CryptoSwift',然后执行 pod install

然后在你的 podfile 中再次添加 pod 'CryptoSwift' 并运行 pod install,它会起作用。

您的 pod 文件将如下所示,

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'CryptoSwiftDemo' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!

    pod 'CryptoSwift'

    # Pods for CryptoSwiftDemo

end

【讨论】:

  • 知道了。谢谢帮助 我的代码有什么错误?
【解决方案2】:

检查框架的swift版本,如果是旧的swift版本,请在项目设置中将“使用旧版Swift语言版本”从“否”切换为“是”。更多信息请参考Use Legacy Swift Language Version - Xcode 8.2

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-07
    • 1970-01-01
    • 1970-01-01
    • 2022-01-08
    • 1970-01-01
    • 2013-04-28
    • 2019-03-14
    相关资源
    最近更新 更多