首页 > 解决方案 > Stripe iOS SDK - 发送不兼容的块指针类型

问题描述

Stripe SDK 导致构建失败。具体错误是:

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

类型为“void (^ _Nonnull)(STPSource * _Nullable __strong, NSHTTPURLResponse * _Nullable __strong, NSError * _Nullable __strong)”的参数

它失败的代码是 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];
}

一切正常 - 然后我相信 Xcode 更新了。现在我遇到了这个问题。我尝试从头开始构建一个新应用程序,除了 Stripe SDK(通过 CocoaPods 安装)之外什么都没有,但没有成功。

在我回滚到早期版本的 Xcode 之前 - 任何帮助将不胜感激。

标签: iosstripe-payments

解决方案


XCode 11.4 打破了 stripe pod v19.0 并在 v19.0.1 中得到修复
以升级 stripe pod,运行pod update Stripe


推荐阅读