#Logcat error during payment flow
1 messages · Page 1 of 1 (latest)
Sorry, I will post again after i do more print log and get more details
I got an error on logcat after calling BillingServices.BuyProduct and close the native purchase dialogue without completing the payment.
E [VoxelBusters.CoreLibrary] Newtonsoft.Json.JsonSerializationException: Error getting value from 'DateUTC' on 'VoxelBusters.EssentialKit.BillingServicesCore.Android.BillingTransaction'. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at VoxelBusters.CoreLibrary.NativePlugins.Android.NativeDate.GetDateTime () [0x00000] in <00000000000000000000000000000000>:0
at VoxelBusters.EssentialKit.BillingServicesCore.Android.BillingTransaction.GetTransactionDateUTCInternal () [0x00000] in <00000000000000000000000000000000>:0
at VoxelBusters.EssentialKit.BillingServicesCore.BillingTransactionBase.get_DateUTC () [0x00000] in <00000000000000000000000000000000>:0
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cult
Got the same error on logcat when I make a successful payment.
- Please add NATIVE_PLUGINS_DEBUG_ENABLED in scripting defines (Player Settings)
- Make a build and reproduce the error
- Pass me the complete logcat log
Okay, will send once i have the log
Here's the logcat starting right after closing the purchase dialogue without making payment.
the error is at line 584 and 616 of the log
Here's the logcat at the start of the app where it retrieve the IAP products
[VoxelBusters] [Type : com.voxelbusters.essentialkit.billingservices.common.BillingTransaction Value : BillingTransaction{id='', productIdentifier='com.skyarkchronicles.re.gem1', isAcknowledged=false, purchaseData='null', purchaseDate=null, state=Failed, verificationState=Unknown, userTag='null', error='null', quantity=0}]
[Type : java.lang.String Value : USER_CANCELED]
Is the crash always happening when you try to cancel the purchase?
@fluid cedar Can you please share me your unity version? I will schedule a test today. I identified where is the problem but wondering why it didn't occur till date. Need to find out if any changes on unity side.
Yes it is 100% repo, the error also shows up after making a successful payment
Appreciate your time on this. We are using unity version 2021.3.17f1
Surprising!
Can you please pass me an apk in development build mode with BillingServicesDemo scene?
Okay, I will do up a build and send you once it is ready
Thankyou!
You may download the apk at
https://drive.google.com/file/d/1zCkHaa7zMtRyhsejppQlZ8xdPnhv73f7/view?usp=drive_link
It seems like the demo scene doesn't give that error anymore for cancelled purchase. We will try to figure how our own purchase flow implementation causes that error on our end first.
However, using the demo scene, we got verification state = failure when doing a successful payment using test payment. Want to know if you have any insight on that.
[VoxelBusters] [Type : com.voxelbusters.essentialkit.billingservices.common.BillingTransaction Value : BillingTransaction{id='GPA.3394-9937-3728-93101', productIdentifier='com.skyarkchronicles.re.gem1', isAcknowledged=false, purchaseData='{"orderId":"GPA.3394-9937-3728-93101","packageName":"com.isekai.ommiii","productId":"com.skyarkchronicles.re.gem1","purchaseTime":1703042918604,"purchaseState":0,"purchaseToken":"nehjepegmhjkopjehjnaefcg.AO-J1OzeJRRxEDz30Doao05f7P1l3vFDZYpyfaz9mSCiLVzoEeA8JZh21i98GT0FktqPBnY-HamXCpAthcIx7HBaty3MV7JtfA","quantity":1,"acknowledged":false}', purchaseDate=Wed Dec 20 11:28:38 GMT+08:00 2023, state=Purchased, verificationState=Failure, userTag='', error='null', quantity=0}]
Please let me check the apk. Btw, can you add me as a licensed tester for sometime and later remove it?
yea, can give me your email address
If so, I will DM.
ok
Thanks Ayyappa for your time. We are finally able to do a successful purchase and verification flow after updating the setting with the correct public key.
Now its fine even for cancel purchases?
For the intial error, we are still trying to debug. The success purchase, verification and cancel are fine when using the demo scene.
I see.
I am not sure if that is related but we actually did not put in any product information in the VB settings.
We actually called the BillingServices.InitializeStore(products.ToArray()); with a list of BillingProductDefinition that we constructed via script.
Will update again to see if that is the reason that causes the error
ok
Hi Ayyappa, we are still getting
E [VoxelBusters.CoreLibrary] Newtonsoft.Json.JsonSerializationException: Error getting value from 'DateUTC' on 'VoxelBusters.EssentialKit.BillingServicesCore.Android.BillingTransaction'. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
When we cancel the payment. Any idea what could have possible caused that? When using the demo scene, it doesn't have this issue. Only when we call BillingServices.BuyProduct from our own UI.
We checked that the BillingServices.InitializeStore was called the same as how it was done in the demo scene.
Ok. I was wondering from where the newtonsoft is getting triggered. We actually use it for rest api utility alone.
Do you use newtonsoft?
Yes we are using newtonsoft and our version is 3.0.2
But we don't use it anywhere related to billing services.
Okay, thanks for the info. Most likely it is related to something on our end. We will try to dig deeper
Anything configured related to newtonsoft on your end i need to be aware?
I don't think there's any newtonsoft configuration. No worries, we will try to dig deeper to pin point what causes that on our side first. WIll update again if there are any finding
Thankyou!