-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
flutter/plugins
#4138Labels
c: fatal crashCrashes that terminate the processCrashes that terminate the processc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 2.2Found to occur in 2.2Found to occur in 2.2has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: in_app_purchasePlugin for in-app purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
What's happening?
- iOS app - Implemented in_app_purchase: ^1.0.6 with the latest version of flutter as of 6 July 2021.
- Buying only consumables.
- As soon as we call
InAppPurchase.instance.buyConsumable - app crashes with the message:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unsupported value for standard codec'
StackTrace
Unsupported value: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" of type NSError
*** Assertion failure in -[FlutterStandardWriter writeValue:], FlutterStandardCodec.mm:330
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unsupported value for standard codec'
*** First throw call stack:
(0x1a521a754 0x1b9ce17a8 0x1a511c3f8 0x1a64f0714 0x101c11520 0x101c11b80 0x101c0eaf8 0x10174ee8c 0x10174cfa0 0x101c0ea60 0x10191fd7c 0x101c29070 0x101bc31d4 0x101bc59fc 0x1a519522c 0x1a5194e28 0x1a5194278 0x1a518e02c 0x1a518d360 0x1bc7cb734 0x1a7c08584 0x1a7c0ddf4 0x100725c70 0x1a4e49cf8)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00000001d344b334 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
- Everything works just fine on Android.
- iOS device: iPhone 12, physical device, with iOS 14.6
- Upon further investigating the stack trace, found that the retrieveReceiptData method in InAppPurchasePlugin.m is called, it returns an error. When the error object is investigated, it is null. Therefore app crashes with message: type 'Null' is not a subtype of type 'Function'
How did I work out the issue temporarily?
In InAppPurchasePlugin.m, changed function retrieveReceiptData:
FROM:
(void)retrieveReceiptData:(FlutterMethodCall *)call result:(FlutterResult)result {
FlutterError *error = nil;
NSString *receiptData = [self.receiptManager retrieveReceiptWithError:&error];
if (error) {
result(error);
return;
}
result(receiptData);
}
TO:
(void)retrieveReceiptData:(FlutterMethodCall *)call result:(FlutterResult)result {
FlutterError *error = nil;
NSString *receiptData = [self.receiptManager retrieveReceiptWithError:&error];
if (error) {
// result(error);
result([FlutterError errorWithCode:@"Code: Could not retrieve receipt data"
message:@"Message: Could not retrieve receipt data"
details:@"Details: Could not retrieve receipt data"]);
return;
}
result(receiptData);
}
Hope there is a fix to the issue in future releases.
vladb99 and Macacoazul01
Metadata
Metadata
Assignees
Labels
c: fatal crashCrashes that terminate the processCrashes that terminate the processc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 2.2Found to occur in 2.2Found to occur in 2.2has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: in_app_purchasePlugin for in-app purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version