-
Notifications
You must be signed in to change notification settings - Fork 16
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
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.optString(java.lang.String)' on a null object reference #5
Comments
@krottv Thanks for the report, strange NPE in Google's billing library, we're researching why it is happening. |
@vladd-g Happens on each call, so app crashes at start-up. The issue is critical. It fixes only after cleaning up app's data/cache |
@krottv Did you notice how it happened? I mean were your app crashing on start from the very first time, or it was okay initially and started crashing after specific actions? Did this crash happen again after clearing app's data? Purchases get synced with Adapty backend under the hood on every app launch. You need to manually call restorePurchases() only if you're using Adapty in observer mode, https://docs.adapty.io/sdk/integrating-adapty-sdk/android-sdk-intro/android-sdk-observer-mode |
@vladd-g |
@krottv Did both versions of the app have the same version of Adapty library? "But I was able to reproduce the scenario a few times." - you mean after clearing data and without reinstalling? Or you installed the previous version again, then the new version, and that was the way you reproduced the crash? |
@vladd-g |
@vladd-g When I updated debug version of the app to release (both had adapty 0.8.6). Seems like it is not very hard to fix. Just introduce additional null check, it happens on your side.
|
@krottv |
@krottv could you please check this error on 1.1.0 (if still occurs, then with suggestion from my previous comment) so that I can close the issue? |
The issue is gone after updaing. |
When calling Adapty.restorePurchases. I use the last version of adapty lib.
The text was updated successfully, but these errors were encountered: