【问题标题】:error build: Stored properties cannot be marked potentially unavailable with '@available' in XCode 14错误构建:无法在 XCode 14 中使用 \'@available\' 将存储的属性标记为可能不可用
【发布时间】:2022-10-25 17:41:41
【问题描述】:

我正在使用stripe/react-native-stripe,但是当我要创建 iOS 版本时。它给了我错误Stored properties cannot be marked potentially unavailable with '@available'。我想解决这个问题,有人可以帮我解决这个问题吗?

【问题讨论】:

  • 这不是一个简单的问题要解决。理想情况下,它需要更新依赖项。您可以自己分叉并执行此操作,但是如果依赖项维护者进行修复可能会更好。目前在他们的 github 上有一个与此 github.com/stripe/stripe-react-native/issues/1144 相关的已关闭问题
  • 请编辑问题以将其限制为具有足够详细信息的特定问题,以确定适当的答案。

标签: javascript ios swift react-native stripe-payments


【解决方案1】:

使用 stripe/react-native-stripe 的更新包版本 Stripe React Native SDK 需要 Xcode 13.2.1 或更高版本,并且是 与面向 iOS 12 或更高版本的应用程序兼容。

然后更改平台:ios 11.0。到 12.0 在 podfile

并更新 Post_install

post_install do |installer|
        installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
              target.build_configurations.each do |config|
                  config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
              end
            end
          end
        end
      end

并运行 pod update 和 pod install 命令 希望这个解决方案对您有用

【讨论】:

    猜你喜欢
    • 2022-10-17
    • 2021-02-24
    • 2022-12-08
    • 2022-11-13
    • 2021-10-15
    • 1970-01-01
    • 2017-06-13
    • 2010-09-20
    • 1970-01-01
    相关资源
    最近更新 更多