Skip to content

Error when using Billing 8.0.0.1 #1231

@jonathanpeppers

Description

@jonathanpeppers

@jonathanpeppers thanks, manually specifying Xamarin.AndroidX.SavedState helps.

However, I now experience a crash using the 8.0.0.1 version when trying to access ResponseCode after calling QueryProductDetailsAsync in certain situations.

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Android.BillingClient.Api.BillingResult'.
   at Java.Interop.JniPeerMembers.AssertSelf(IJavaPeerable self) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.cs:line 153
   at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeAbstractInt32Method(String encodedMember, IJavaPeerable self, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:line 484
   at Android.BillingClient.Api.BillingResult.get_ResponseCode() in D:\a\_work\1\s\generated\com.android.billingclient.billing\obj\Release\net9.0-android35.0\generated\src\Android.BillingClient.Api.BillingResult.cs:line 253
var productList = new[] { QueryProductDetailsParams.Product.NewBuilder().SetProductId(sku).SetProductType(productType).Build() };
var _params = QueryProductDetailsParams.NewBuilder().SetProductList(productList).Build();
var returnValue = await billingClient.QueryProductDetailsAsync(_params);
if (returnValue.Result.ResponseCode == BillingResponseCode.Ok) { ... } // <-- crashes here
image

The same code does not crash when using 7.1.1.4

Originally posted by @tipa in #1207 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions