'new' 不可用:您不能直接实例化 STPIssuingCardPin [英] 'new' is unavailable: You cannot directly instantiate an STPIssuingCardPin

查看:32
本文介绍了'new' 不可用:您不能直接实例化 STPIssuingCardPin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚更换了配备 M1 芯片的新 MacBook Pro,但无法在 Xcode 上构建我的应用程序.我已经更新了所有的 cocoaPods 并且已经在终端中安装了 sudo gem cocoa pods install 命令和 Rosetta.这是我得到的两个错误并使构建失败:

I've just changed to a new MacBook Pro with the M1 chip and I can't build my app on Xcode. I've already updated all cocoaPods and have already installed the sudo gem cocoa pods install command in the terminal with Rosetta. These are the two errors I get and make the build Fail:

'new' is unavailable: You cannot directly instantiate an STPIssuingCardPin

推荐答案

2021 年 4 月的现状...

As it stands in April, 2021...

TL;DR

根据 Pull Request #1766修复与 Xcode 12.5 的兼容性",因此大多数解决方案是升级到 21.3.1 或更高版本.

This is happening since Xcode 12.5, fixed in Stripe 21.3.1, backported to 19.4.1, 17.0.3, 15.0.2, and 14.0.1, according to Pull Request #1766 'Fix compatibility with Xcode 12.5', so the solution for most will be to upgrade to 21.3.1 or above.

可可豆

对于那些使用 Cocoapods 的人(例如 React Native 起始版本 0.60):请注意,除了 21.3.1,上面列出的其他 Stripe 版本似乎都没有在 Stripe 的 Cocoapods 更新日志页面,并且,根据 问题#1767Cocoapods 中仍然缺少 19.4.1 版,而 20.1.2 怎么样?",看来它们不会,至少不会是 19.4.1,这是我所需要的,因为将 Stripe 升级到版本 19 以上会导致 tipsi-stripe 错误,我用来在我的 React Native 应用中实现卡支付的库.

For those of you who are using Cocoapods (eg. React Native starting version 0.60): note that, with the exception of 21.3.1, none of the other Stripe versions listed above appear to be available on Stripe's Cocoapods changelog page, and, according to Issue #1767 'ver 19.4.1 is still missing from Cocoapods and How about 20.1.2?', it appears they won't be, at least not 19.4.1, which is what I needed, as upgrading Stripe above version 19 caused errors with tipsi-stripe, the library I used to implement card payment in my React Native app.

降级 Xcode

当然,如果您迫切需要这个并且想要一个快速而肮脏的方法,最简单的替代方法是降级到 Xcode 12.4.如果你像我一样继续升级,不知道潜在的后果,你可以去 Apple 的下载更多"部分并从那里获取.

The simplest alternative, of course, if you need this urgently and want a quick and dirty method, is to downgrade to Xcode 12.4. If you just went ahead and upgraded, like I did, not knowing the potential consequences, you can go to Apple's Download 'more' section and get it from there.

Stripe 的新兴 RN 库

顺便提一下,Stripe 即将发布其 React Native (RN) 库,我已签约成为其私人测试版计划的合作者,主要报告较小的外观错误.它已经接近完成,我可以成功地用它替换 tipsi-stripe .新库中使用的 Stripe 版本高于最新的修复版本,因此该错误不再出现.

As a side note, Stripe is about to release its React Native (RN) library, and I have signed up to be a collaborator in its private beta progam, reporting smaller cosmetic bugs mainly. It's already so close to completion, that I could successfully replace tipsi-stripe with it. The Stripe version used in the new library is above the latest fix version, so this error is not appearing there anymore.

修改 2021 年 5 月

Stripe 的 RN 库现在处于公开测试阶段;你可能想试一试:https://github.com/stripe/stripe-react-原生

Stripe's RN library is now in public beta; you might want to give it a try: https://github.com/stripe/stripe-react-native

这篇关于'new' 不可用:您不能直接实例化 STPIssuingCardPin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆