Could you provide the steps you are using to reproduce this error?
Are you using coded or codeless IAP? Could you share your implementation?
If you had a working version of IAP before 4.5.2, which version was it?
What device is this happening on? Have you tried others?
We have an ANR fix coming up in IAP 4.6.0 that can happen while pausing/unpausing, could this be your case?
Thank you for the answers, here’s a few more question:
The code seems good. as long as the initialization doesn’t fail (it’s not recommended to initialize IAP more than once).
In your case, does the initialization succeed or fail when you get this problem?
If you try 4.4.1 again, does it work or same problem?
Could you obtain the device log instead of the Google Play Console? Or is there more logs available?
Do you know the specific devices and OS versions that have the error?
So far nothing seems wrong on the IAP side and the logs don’t have any information pointing to either BillingClient or Unity IAP, so I will need more information on the problem or steps to reproduce.
The logs don’t have much information regarding IAP other than the BillingClient lines which makes it hard to say what the problem is. It seems there’s a callback from the Google Billing Client being blocked on the main thread.
There’s a limitation of the Billing Client where some of its methods are only invoked on the main thread: https://developer.android.com/reference/com/android/billingclient/api/BillingClient
Is it possible that while IAP is being initialized or a purchase is being made, there could be something else blocking the main thread?
Also, what version of Unity Services Core are you using? Updating to 1.7.0 might also help.
We also have 4.6.0 coming out soon that fixes an ANR, so this might solve your issue!
Hi, we are using unity purchasing 4.6.0 and are facing some ANR related to
com.android.billingclient:billing@@4.0.0, but we are not sure if this is the same problem as this thread. Log is in the attachment file. Thanks for the support.
Hello leochien,
Thank you for the report, this one related to BillingClientStateListener.onBillingServiceDisconnected() is fixed for 4.7.0 coming out soon.
In one of your screenshots, it says that the main thread is blocked and is trying to acquire a lock held by thread 116.
Does your logs have the stack trace from that thread? If yes, could you provide it?
Also, in our next release 4.8.0, we are upgrading to Google Billing v5 (minimal upgrade, no new features) which might fix this issue since it started with Google Billing v4.
Hello!
I apologise for the long reply, been busy with other tasks. It’s been a long time, the project is already on a different version of Unity and a new version of IAP. But the error still persists. Now it is with the new version.
UNITY 2021.3.30f + IAP 4.9.4
ANR
com.android.billingclient:billing@@5.2.1 - com.android.billingclient.api.zzap.zzdInput dispatching timed out
There’s a Google tip. But I don’t understand what kind of blocking tread they’re talking about? How to track it?
I’m having the same problem. I also wrote about a similar issue in another thread, but didn’t get a reply from Unity. If anyone knows if this is a Google issue or not, please reply.