Giter Club home page Giter Club logo

Comments (10)

vladd-g avatar vladd-g commented on May 29, 2024

@krottv Thanks for the report, strange NPE in Google's billing library, we're researching why it is happening.

from adaptysdk-android.

krottv avatar krottv commented on May 29, 2024

@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
Also how is Adapty.getPurchaserInfo() is different from Adapty.restorePurchases? Will getPurchaserInfo restore them if before I in the app I used simple Google billing lib?

from adaptysdk-android.

vladd-g avatar vladd-g commented on May 29, 2024

@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

from adaptysdk-android.

krottv avatar krottv commented on May 29, 2024

@vladd-g
It seems that crashes started after I uploaded new version of the app on my device. And then it crashed on every start-up. After cleaning app's data the crash never happened again.
But I was able to reproduce the scenario a few times.

from adaptysdk-android.

vladd-g avatar vladd-g commented on May 29, 2024

@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?

from adaptysdk-android.

krottv avatar krottv commented on May 29, 2024

@vladd-g
I reproduced by installing old version again, and updating it to the new version. The old version didn't have Adapty at all, it had https://github.com/serso/android-checkout. The new version has Adapty 0.8.4

from adaptysdk-android.

krottv avatar krottv commented on May 29, 2024

@vladd-g
I cought a similar crash when calling Adapty.getPurchaserInfo

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.

 java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.optString(java.lang.String)' on a null object reference
        at com.adapty.api.entity.restore.RestoreItem.setDetails(RestoreItem.kt:3)
        at com.adapty.purchase.InAppPurchases.fillProductInfoFromCache(InAppPurchases.kt:6)
        at com.adapty.purchase.InAppPurchases.access$fillProductInfoFromCache(InAppPurchases.kt:1)
        at com.adapty.purchase.InAppPurchases$queryPurchaseHistory$1.onPurchaseHistoryResponse(InAppPurchases.kt:28)
        at a.d.a.a.q.run(com.android.billingclient:billing@@3.0.2:361)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7698)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)

from adaptysdk-android.

vladd-g avatar vladd-g commented on May 29, 2024

@krottv
It may be an obfuscation issue, please try adding -keep class com.android.billingclient.** { *; } to your proguard config

from adaptysdk-android.

vladd-g avatar vladd-g commented on May 29, 2024

@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?

from adaptysdk-android.

krottv avatar krottv commented on May 29, 2024

The issue is gone after updaing.

from adaptysdk-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.