#Logcat error during payment flow

1 messages · Page 1 of 1 (latest)

frank wind
#

Do you have complete logcat log? Is it reproducible 100% if so can you please share the steps?

iron magnet
#

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.

frank wind
#
  1. Please add NATIVE_PLUGINS_DEBUG_ENABLED in scripting defines (Player Settings)
  2. Make a build and reproduce the error
  3. Pass me the complete logcat log
iron magnet
#

Okay, will send once i have the log

iron magnet
#

the error is at line 584 and 616 of the log

iron magnet
#

Here's the logcat at the start of the app where it retrieve the IAP products

frank wind
#
[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?

frank wind
#

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

iron magnet
iron magnet
frank wind
iron magnet
#

Okay, I will do up a build and send you once it is ready

frank wind
#

Thankyou!

iron magnet
#

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}]
frank wind
#

Please let me check the apk. Btw, can you add me as a licensed tester for sometime and later remove it?

iron magnet
#

yea, can give me your email address

frank wind
#

If so, I will DM.

iron magnet
#

ok

iron magnet
#

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.

frank wind
iron magnet
#

For the intial error, we are still trying to debug. The success purchase, verification and cancel are fine when using the demo scene.

frank wind
#

I see.

iron magnet
#

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

frank wind
#

ok

iron magnet
#

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.

frank wind
#

Ok. I was wondering from where the newtonsoft is getting triggered. We actually use it for rest api utility alone.

#

Do you use newtonsoft?

iron magnet
#

Yes we are using newtonsoft and our version is 3.0.2

frank wind
iron magnet
#

Okay, thanks for the info. Most likely it is related to something on our end. We will try to dig deeper

frank wind
#

Anything configured related to newtonsoft on your end i need to be aware?

iron magnet
#

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

frank wind
#

Thankyou!