Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Null reference in Xamarin.InAppBilling

$
0
0

Hey guys,

Still struggling to get the billing going, it seems close but when I test in my beta app I get a crash on a cancellation of the purchase. I'm not sure if it's exactly this error below, as I've had a bit of trouble with working out how to debug given it's a release, but in Release mode (with debugging enabled in assembly info) and deployed to my local phone, I get the following when I hit "ok" on a failed purchase (note: failure is because i'm using my developer account on the phone).

[InApp-Billing] Completed Purchase Error System.ArgumentNullException: Argument cannot be null.
[InApp-Billing] Parameter name: value
[InApp-Billing]   at Newtonsoft.Json.Utilities.ValidationUtils.ArgumentNotNull (System.Object value, System.String parameterName) [0x00000] in <filename unknown>:0 
[InApp-Billing]   at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <filename unknown>:0 
[InApp-Billing]   at Newtonsoft.Json.JsonConvert.DeserializeObject[Purchase] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <filename unknown>:0 
[InApp-Billing]   at Newtonsoft.Json.JsonConvert.DeserializeObject[Purchase] (System.String value) [0x00000] in <filename unknown>:0 
[InApp-Billing]   at Xamarin.InAppBilling.InAppBillingHandler.HandleActivityResult (Int32 requestCode, Result resultCode, Android.Content.Intent data) [0x00000] in <filename unknown>:0 : Unable to deserialize purchase ''.
[InApp-Billing]  Setting Purchase.DeveloperPayload with info returned from Google.
[MonoDroid] UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
[MonoDroid] at Xamarin.InAppBilling.InAppBillingHandler.HandleActivityResult (int,Android.App.Result,Android.Content.Intent) <0x001e4>
[MonoDroid] at CrossAndroid.Activity1.OnActivityResult (int,Android.App.Result,Android.Content.Intent) <0x00057>
[MonoDroid] at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (intptr,intptr,int,int,intptr) <0x00073>
[MonoDroid] at (wrapper dynamic-method) object.4dbf3aca-2e17-443d-917a-54a82ccc595d (intptr,intptr,int,int,intptr) <0x0005b>
[mono] 
[mono] Unhandled Exception:
[mono] System.NullReferenceException: Object reference not set to an instance of an object
[mono]   at Xamarin.InAppBilling.InAppBillingHandler.HandleActivityResult (Int32 requestCode, Result resultCode, Android.Content.Intent data) [0x00000] in <filename unknown>:0 
[mono]   at CrossAndroid.Activity1.OnActivityResult (Int32 requestCode, Result resultCode, Android.Content.Intent data) [0x00000] in <filename unknown>:0 
[mono]   at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (IntPtr jnienv, IntPtr native__this, Int32 requestCode, Int32 native_resultCode, IntPtr native_data) [0x00000] in <filename unknown>:0 
[mono]   at (wrapper dynamic-method) object:4dbf3aca-2e17-443d-917a-54a82ccc595d (intptr,intptr,int,int,intptr)
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
[mono-rt]   at Xamarin.InAppBilling.InAppBillingHandler.HandleActivityResult (Int32 requestCode, Result resultCode, Android.Content.Intent data) [0x00000] in <filename unknown>:0 
[mono-rt]   at CrossAndroid.Activity1.OnActivityResult (Int32 requestCode, Result resultCode, Android.Content.Intent data) [0x00000] in <filename unknown>:0 
[mono-rt]   at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (IntPtr jnienv, IntPtr native__this, Int32 requestCode, Int32 native_resultCode, IntPtr native_data) [0x00000] in <filename unknown>:0 
[mono-rt]   at (wrapper dynamic-method) object:4dbf3aca-2e17-443d-917a-54a82ccc595d (intptr,intptr,int,int,intptr)

Would appreciate any help at all, I'm a bit stumped on this one.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>