Hello!
In my game I have a situation when I need to restore() item, then finish() it, then buy() and so on.
It looks like the case isn’t implemented yet because after reloading the app I have strange behaviour like loosing ability to restore item or to buy it or I catch an exception.
Here is a stack trace of the exception:
01-21 20:00:33.975 19469 19469 E AndroidRuntime: FATAL EXCEPTION: main
01-21 20:00:33.975 19469 19469 E AndroidRuntime: Process: ..., PID: 19469
01-21 20:00:33.975 19469 19469 E AndroidRuntime: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
01-21 20:00:33.975 19469 19469 E AndroidRuntime: at java.util.ArrayList.get(ArrayList.java:437)
01-21 20:00:33.975 19469 19469 E AndroidRuntime: at com.defold.iap.IapGooglePlay$5.onSkuDetailsResponse(IapGooglePlay.java:343)
01-21 20:00:33.975 19469 19469 E AndroidRuntime: at com.defold.iap.IapGooglePlay$6.onSkuDetailsResponse(IapGooglePlay.java:376)
01-21 20:00:33.975 19469 19469 E AndroidRuntime: at com.android.billingclient.api.zzj.run(com.android.billingclient:billing@@3.0.0:8)
01-21 20:00:33.975 19469 19469 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873)
01-21 20:00:33.975 19469 19469 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
01-21 20:00:33.975 19469 19469 E AndroidRuntime: at android.os.Looper.loop(Looper.java:201)
01-21 20:00:33.975 19469 19469 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6864)
01-21 20:00:33.975 19469 19469 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-21 20:00:33.975 19469 19469 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
01-21 20:00:33.975 19469 19469 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Steps to reproduce the behavior:
- Make function which calls iap.restore(), then iap.finish(), then iap.buy(), then iap.acknowledge() on purchased
- Call the function
- Restart app
- Call the function
- And so on
- See behaviour
Defold version:
- Version 1.2.178
IAP Extension version
- Version 3.0.0
Platforms:
- Android