RevenueCat / purchases-flutter

Flutter plugin for in-app purchases and subscriptions. Supports iOS, macOS and Android.
https://www.revenuecat.com/
MIT License
608 stars 169 forks source link

Canceling subscription crashes app in production #1207

Open TijlIvens opened 1 day ago

TijlIvens commented 1 day ago

‼️ Required data ‼️

Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

There are a lot of things that can contribute to things not working. Having a very basic understanding of your environment will help us understand your issue faster!

Environment

• No issues found!

- [x] Version of `purchases-flutter`
  `8.2.1`
- [x] Testing device version e.g.: iOS 15.5, Android API 30, etc.
iOS 17.7
- [x] How often the issue occurs- every one of your customers is impacted? Only in dev?
Only happens in production builds with real subscriptions. On all tested devices.
Never with a sandbox environment.
- [x] [Debug logs](https://docs.revenuecat.com/docs/debugging) that reproduce the issue

0 (null) in assertionFailure(:_:file:line:flags:) ()

1 0x000000010056c3fc in closure #1 in variable initialization expression of static FatalErrorUtil.defaultFatalErrorClosure at /Users/stijl/dev/receptenvansandra_app/ios/Pods/PurchasesHybridCommon/ios/PurchasesHybridCommon/PurchasesHybridCommon/FatalErrorUtil.swift:15

2 0x000000010056c3fc in fatalError(_:file:line:) at /Users/stijl/dev/receptenvansandra_app/ios/Pods/PurchasesHybridCommon/ios/PurchasesHybridCommon/PurchasesHybridCommon/FatalErrorUtil.swift:27

3 0x000000010056c3fc in static CommonFunctionality.sharedInstance.getter at /Users/stijl/dev/receptenvansandra_app/ios/Pods/PurchasesHybridCommon/ios/PurchasesHybridCommon/PurchasesHybridCommon/CommonFunctionality.swift:21

4 0x000000010056c3fc in static CommonFunctionality.customerInfo(fetchPolicy:completion:) ()

5 0x000000010056c3fc in specialized static CommonFunctionality.customerInfo(completion:) at /Users/stijl/dev/receptenvansandra_app/ios/Pods/PurchasesHybridCommon/ios/PurchasesHybridCommon/PurchasesHybridCommon/CommonFunctionality.swift:380

6 (null) in @objc static CommonFunctionality.restorePurchases(completion:) ()

7 0x0000000100dae150 in -[PurchasesFlutterPlugin getCustomerInfoWithResult:] at /Users/stijl/.pub-cache/hosted/pub.dev/purchases_flutter-8.2.1/ios/Classes/PurchasesFlutterPlugin.m:373

8 0x0000000100dac974 in -[PurchasesFlutterPlugin handleMethodCall:result:] at /Users/stijl/.pub-cache/hosted/pub.dev/purchases_flutter-8.2.1/ios/Classes/PurchasesFlutterPlugin.m:104

9 0x0000000103fb770c in __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke ()

10 0x000000010392ae38 in invocation function for block in flutter::PlatformMessageHandlerIos::HandlePlatformMessage(std::_fl::unique_ptr<flutter::PlatformMessage, std::_fl::default_delete>) ()


- [x] Steps to reproduce, with a description of expected vs. actual behavior
In a production environment
Load subscriptions in the app
Click on a subscription
Native popup will open
Close subscription popu
App crashes

## Describe the bug ##
The app will crash on iOS when you close the native subscriptions popup of apple. Only in production.

## Additional context ##
The error shows an error that the purchases SDK is not configured. But The subscriptions can be fetched correctly from revenueCat. No issues when doing this in a sandox. 
RCGitBot commented 1 day ago

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!