-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is no singleton instance #1090
Comments
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out! |
Hi @mpastewski, |
Hi @mshmoustafa, Thanks for the note. Unfortunately, I wasn't able to identify it... Please check the full exception message below:
|
Thank you! Let me ask a mobile engineer for input on this. |
Hi @mpastewski, Yes, you are correct that you should not try to make any calls to Purchases until you have configured the SDK. A member of our engineering team took a look at the stack trace and did confirm that it is a result of attempting to display a paywall before calling configure. Are there any other places where you potentially use Paywalls prior to the configure? |
Hey @mpastewski, |
This issue still persists, We had checked the isConfigured status before executing any rc methods. Please fix !! |
I can confirm that the issue still persists, calling and awaiting on |
I am experiencing the same. I call |
Confirming exactly the same behaviour. |
I can confirm that I'm also experiencing the same issue. |
+1 |
Hi getting this issue almost daily logged on my crashlytics: |
Facing same issue |
I can also confirm this. |
There is still a problem. Please open it |
Thanks, everyone, for continuing to report this. We recently identified that this can happen on Android if:
This issue has been fixed in purchases-flutter 8.1.6. Can you please upgrade and let us know if this has been resolved? If you continue to experience this issue after upgrading, please share breadcrumb logs and the launchMode as these will help our team dig further into this. Thanks. |
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
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.6, on macOS 14.5 23F79 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.89.1)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!
purchases-flutter
purchases_flutter: ^6.29.0
Android 12-14. Might also affect older Android versions
Affecting 3% of users in production according to Crashlytics
Fatal Exception: bi.g0: There is no singleton instance. Make sure you configure Purchases before trying to get the default instance. More info here: https://errors.rev.cat/configuring-sdk
I am not able to reproduce it at this stage
Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Describe the bug
According to Crashlytics, 3% are affected by this issue, causing fatal crash. I encapsulated RevenueCat functionality under the class below and only using this two functions to display paywall built on RevenueCat.
Additional context
On main screen init, I am calling (inside initState):
I always use PaywallLogic class to call RevenueCat. I tried to replace
await Purchases.isConfigured == false
with a custom boolean flag to track if RevenueCat has been already initiated or not, but it didn't help - I was thinking that I shouldn't use Purchases at all before configuration, however it also did not help.The text was updated successfully, but these errors were encountered: