Comments (10)
@krottv Thanks for the report, strange NPE in Google's billing library, we're researching why it is happening.
from adaptysdk-android.
@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.
@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.
@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.
@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.
@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.
@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.
@krottv
It may be an obfuscation issue, please try adding -keep class com.android.billingclient.** { *; }
to your proguard config
from adaptysdk-android.
@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.
The issue is gone after updaing.
from adaptysdk-android.
Related Issues (20)
- Fatal Exception: java.lang.NullPointerException HOT 2
- Fatal Exception: java.lang.NullPointerException HOT 2
- Promo Codes on Google Play not working for Lifetime products. HOT 3
- Billing Client 5.0.0 (latest) support HOT 6
- Free trial period is set though not applicable (Android) HOT 4
- Adapty SDK is leaking resources HOT 11
- googleValidationResult is null on restorePurchase HOT 3
- Error: No virtual method: queryPurchases HOT 3
- Unable to get paywall with SDK version 2.0.0 HOT 4
- Why not for java? HOT 1
- Android Billing Library v5 REQUIRED for all app updates after November 1st HOT 1
- SDK version 2.8.0 crashes when api.adapty.io host name is not resolved HOT 2
- Repeated calls to https://api.adapty.io/api/v1/sdk/analytics/profiles/.../ when internet connection offline HOT 1
- StrictMode policy violation HOT 2
- Crash related to missing WebView HOT 1
- Crash in release build - TTypeToken must be created with a type argument: new TypeToken<...>() {}; When using code shrinkers (ProGuard, R8, ...) make sure that generic signatures are preserved. HOT 2
- Android Lifecycle integration HOT 2
- Fatal Exception: kotlin.TypeCastException null cannot be cast to non-null type com.adapty.utils.di.DIObject<T> com.adapty.utils.di.Dependencies.injectInternal HOT 5
- Fatal Exception: java.lang.NullPointerException Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.optString(java.lang.String)' on a null object reference HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adaptysdk-android.