adaptyteam / AdaptyUI-React-Native

Extension to the Adapty SDK that allows you to easily add purchase screens to your application
https://adapty.io
MIT License
29 stars 2 forks source link

java.lang.NullPointerException at com.adapty.internal.crossplatform.ui.Dependencies.injectInternal$default #13

Open hasanfd opened 6 months ago

hasanfd commented 6 months ago

My android app crashed two times with this NPE

java.lang.NullPointerException at com.adapty.internal.crossplatform.ui.Dependencies.injectInternal$default

image

This is from sentry 👆 It looks like coders/parse.js is throwing this error. Can you take a look? Thanks

hasanfd commented 6 months ago

Hello team, I understand this could be because of an error in google services. But the app crashed. An error in google service should not end up with a crash. Can you guide me to prevent this? I am using your example code. Such as,

try {
    const paywall = await adapty.getPaywall(placement_id, locale);
    const view = await createPaywallView(paywall);
    view.registerEventHandlers({ ... })

    await view.present();
    await adapty.logShowPaywall(paywall);

  } catch (error) {
   ...
  }

Can I prevent this by adding catch somewhere? or is it internally happening?

vladd-g commented 3 months ago

hello @hasanfd, thank you for the report!

could you please provide more of the stacktrace for the NPE? thank you!