简体   繁体   English

Stripe iOS SDK - 不兼容的块指针类型发送

[英]Stripe iOS SDK - Incompatible block pointer types sending

The Stripe SDK is causing a build a failure. Stripe SDK 导致构建失败。 The specific error is:具体错误是:

Incompatible block pointer types sending '__strong STPAPIResponseBlock _Nonnull' (aka 'void (^__strong)(ResponseType _Nullable __strong, NSHTTPURLResponse * _Nullable __strong, NSError * _Nullable __strong)')不兼容的块指针类型发送 '__strong STPAPIResponseBlock _Nonnull'(又名 'void (^__strong)(ResponseType _Nullable __strong, NSHTTPURLResponse * _Nullable __strong, NSError * _Nullable __strong)')

to parameter of type 'void (^ _Nonnull)(STPSource * _Nullable __strong, NSHTTPURLResponse * _Nullable __strong, NSError * _Nullable __strong)'到类型'void (^ _Nonnull)(STPSource * _Nullable __strong, NSHTTPURLResponse * _Nullable __strong, NSError * _Nullable __strong)'的参数

The code it is failing on is the following within STPAPIClient.m...它失败的代码是 STPAPIClient.m 中的以下代码...

- (NSURLSessionDataTask *)retrieveSourceWithId:(NSString *)identifier clientSecret:(NSString *)secret responseCompletion:(STPAPIResponseBlock)completion {
    NSString *endpoint = [NSString stringWithFormat:@"%@/%@", APIEndpointSources, identifier];
    NSDictionary *parameters = @{@"client_secret": secret};
    return [STPAPIRequest<STPSource *> getWithAPIClient:self
                                               endpoint:endpoint
                                             parameters:parameters
                                           deserializer:[STPSource new]
                                             completion:completion];
}

Everything was working fine - and then I believe Xcode updated.一切正常 - 然后我相信 Xcode 更新了。 Now I get this problem.现在我遇到了这个问题。 I tried building a new app from scratch with nothing in it other then the Stripe SDK (installed via CocoaPods) and that failed to.我尝试从头开始构建一个新的应用程序,除了 Stripe SDK(通过 CocoaPods 安装)之外什么都没有,但失败了。

Before I rollback to an earlier version of Xcode - any help would be much appreciated.在我回滚到早期版本的 Xcode 之前 - 任何帮助将不胜感激。

XCode 11.4 broke the stripe pod v19.0 and it got fixed in v19.0.1 XCode 11.4 破坏了条纹 pod v19.0 并在 v19.0.1 中得到修复
to upgrade the stripe pod, run pod update Stripe升级stripe pod,运行pod update Stripe

Update with fixes : "We've released v14.0.1, v15.0.2, v17.0.3, and v19.0.1 to Cocoapods with fixes for this issue.": https://github.com/stripe/stripe-ios/issues/1525#issuecomment-604037716更新修复:“我们已经向 Cocoapods 发布了 v14.0.1、v15.0.2、v17.0.3 和 v19.0.1,并修复了这个问题。”: https : //github.com/stripe/stripe-ios/issues /1525#issuecomment-604037716

Older post info :较旧的帖子信息

This is fixed by Stripe in this change: https://github.com/stripe/stripe-ios/pull/1526这在此更改中由 Stripe 修复: https : //github.com/stripe/stripe-ios/pull/1526

If you're stuck on an older version of Stripe, you can try applying the two changes to your local version.如果您坚持使用旧版本的 Stripe,您可以尝试将这两个更改应用到您的本地版本。 (Changes at https://github.com/stripe/stripe-ios/pull/1526/files ). (更改在https://github.com/stripe/stripe-ios/pull/1526/files )。

I did this:我这样做了:

in Podfile.lock i have changed - Stripe (19.0.0) to - Stripe (19.0.1) and then in terminal in the directory of ios ran "pod update Stripe" .Podfile.lock我已将- Stripe (19.0.0)更改为- Stripe (19.0.1)然后在 ios 目录的终端中运行“pod update Stripe” I'm using flutter and for me it worked.我正在使用颤振,对我来说它奏效了。

Also ran into this, but am on the v14 version of the stripe pod.也遇到了这个问题,但我使用的是 v14 版本的 Stripe pod。 The only option I can find for people in my position is to revert back to xcode 11.3.1.我能找到的唯一选择是恢复到 xcode 11.3.1。

You can set your stripe SDK to Version 19.0.1 to fix this issue.您可以将条带 SDK 设置为版本 19.0.1 来解决此问题。

pod 'Stripe', '~> 19.0.1'豆荚“条纹”,“~> 19.0.1”

OR else update your stripe pod to latest version by pod update command.或者通过 pod update 命令将您的条带 pod 更新到最新版本。

I had this problem too, it was xcode 11.4 update and i was running stripe v15.0.1.我也有这个问题,它是 xcode 11.4 更新,我运行的是 Stripe v15.0.1。

I´ve just updated my stripe version to v15.0.2.我刚刚将我的条带版本更新到 v15.0.2。 Depending your version you can check this: https://github.com/stripe/stripe-ios/issues/1525#issuecomment-604037716根据您的版本,您可以查看: https : //github.com/stripe/stripe-ios/issues/1525#issuecomment-604037716

我在 Pod 文件中将 Stripe SDK 设置为版本 19.0.1 并运行 pod update 命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM