Trying to build my React-Native app for iOS. Previous build was fine, but since I added Sentry for error logging, I can not build it. Linking was fine, I did it and it was successful.
I am getting this error:
Too many arguments to block call, expected 1, have 3
RNSentry.m
inside this part of code:
RCT_EXPORT_METHOD(sendEvent:(NSDictionary * _Nonnull)event
resolve:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul), ^{
if ([NSJSONSerialization isValidJSONObject:event]) {
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:event
options:0
error:nil];
SentryEvent *sentryEvent = [[SentryEvent alloc] initWithJSON:jsonData];
[SentryClient.sharedClient sendEvent:sentryEvent withCompletionHandler:^(NSError * _Nullable error) {
if (nil != error) {
reject(@"SentryReactNative", error.localizedDescription, error);
} else {
resolve(@YES);
}
}];
} else {
reject(@"SentryReactNative", @"Cannot serialize event", nil);
}
});
}
on this line:
reject(@"SentryReactNative", error.localizedDescription, error);
I am using RN version 0.59.9
and React version is 16.8.3
Tried to google if someone had similar issues but found nothing. Any help will be appreciated.