Solved

There is no singleton instance. Make sure you configure Purchases before trying to get the default instance.

  • 30 November 2021
  • 1 reply
  • 57 views

Badge +1

Hello,

I have user crashes related to configuring Purchases.  However, when i have experienced this crash, it is when i am trying to close the app.  I have a single exit point and use:

startActivity(intent);finish();before moving to a new intent.  My exit looks like the following
Thread.currentThread().interrupt();finish();System.exit(0);finish();

Any thoughts?

icon

Best answer by cody 10 December 2021, 19:16

View original

1 reply

Userlevel 4
Badge +8

Hey @Dunwiddie!

It looks like you’re trying to access Purchases at some point before it has been configured, or after it’s been destroyed. I’d recommend checking isConfigured before trying to access it: https://github.com/RevenueCat/purchases-android/blob/6a3901a74ae2a39313e8849e4660bc883d6fde61/purchases/src/main/kotlin/com/revenuecat/purchases/Purchases.kt#L1806

Reply