【问题标题】:'exported: true' has no effect in '_specialize' attribute in Xcode 12.5'exported: true' 在 Xcode 12.5 中的 '_specialize' 属性中无效
【发布时间】:2021-04-29 03:41:08
【问题描述】:

在我的机器上,Xcode 已自动升级到最新版本的 Xcode 12.5。我现在在构建我的项目时面临问题。昨天它在 Xcode 12.4 上完美运行,没有代码更改或库更改。字面上相同的代码库。

任何人都面临这个问题的解决方案?

收到错误消息:

'exported: true' has no effect in '_specialize' attribute

尝试过(但没有帮助):

  1. 重启机器
  2. 杀死并重新启动 Xcode
  3. 干净的构建
  4. 删除派生数据

【问题讨论】:

  • 看起来 CryptoSwift pod 有问题。尝试解构并重新开始使用您的 pod。
  • 我暂时下载了12.4版本继续我的工作,将再次访问这个话题。谢谢你的推荐。我相信pod update 可以解决这个问题

标签: ios xcode12


【解决方案1】:

我已经解决了运行pod update 的问题,而不是在我的Podfile 中指向特定版本

否则,您也可以按照@coryhowell 指出的内容进行操作,

移除 pod 并将其添加为 Swift 包(版本 1.4.0)

Podfile

platform :ios, '11.4'
use_frameworks!
inhibit_all_warnings!

target 'myAppp' do
  pod 'Alamofire', '~> 4.8.1'
  pod 'CryptoSwift'
end

Podfile.lock - 自动创建,然后指向 CryptoSwift 的最新版本

PODS:
  - Alamofire (4.8.2)
  - Countly (20.11.1):
    - Countly/Core (= 20.11.1)
  - Countly/Core (20.11.1)
  - Crashlytics (3.12.0):
    - Fabric (~> 1.9.0)
  - CryptoSwift (1.4.0)
  - Device (3.1.2)
  - Fabric (1.9.0)

..
...
not showing all lines
....
......

【讨论】:

    【解决方案2】:

    我在 CryptoSwift pod 上遇到了同样的问题。 Xcode 12.5 使用的是 Swift 5.4。我认为 CryptoSwift 尚未针对 swift 5.4 进行更新。我切换回 Xcode 12.4 并运行 pod install。它再次在 Xcode 12.4 上构建。 CryptoSwift 最新版本仅支持 Swift 5.3

    更新

    我无法让 CryptoSwift 使用可可豆荚更新过去的 1.2.0 版本。我删除了 pod 并将其添加为 Swift 包(版本 1.4.0)。我能够使用 Xcode 12.5 构建

    Confirmed this was fixed in CryptoSwift 1.3.2

    【讨论】:

      【解决方案3】:
      1. 删除旧版本
      2. 重新安装最新版本

      【讨论】:

        【解决方案4】:

        这是因为@_specialize标签在Swift 5.4(Xcode 12.5)中改变了,你可以用正则表达式替换:

        @_specialize\(([^,]+),\s([^)]+)\)
        @_specialize\($2\)
        

        【讨论】:

          【解决方案5】:

          只需评论 all @_specialize(exported: true, where T == ArraySlice<UInt8>) 等...它应该可以工作。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2022-11-30
            • 2021-12-09
            • 2012-12-22
            • 2021-07-29
            • 2015-12-04
            • 1970-01-01
            • 2014-01-29
            • 2021-08-12
            相关资源
            最近更新 更多