Skip to main content
Question

【Flutter】The product is not available for purchase.


Forum|alt.badge.img

When running in debug mode in Visual Studio Code, the following error occurs when executing the line below:
CustomerInfo customerInfo = await Purchases.purchasePackage(package);

 

Error:
E/[Purchases] - ERROR(22467): 🤖‼️ BillingWrapper purchases failed to update: DebugMessage: . ErrorCode: ITEM_UNAVAILABLE.null
E/[Purchases] - ERROR(22467): 🤖‼️ PurchasesError(code=ProductNotAvailableForPurchaseError, underlyingErrorMessage=Error updating purchases. DebugMessage: . ErrorCode: ITEM_UNAVAILABLE., message='The product is not available for purchase.')

However, when I install the app from the Google Play Store, which is already published in the closed test track, and execute it, I can make purchases with a Sandbox test account.Is it not possible to test RevenueCat in debug mode? Do I need to upload the app bundle file to the closed test track every time to perform the tests?

This post has been closed for comments

2 replies

kaitlin
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 376 replies
  • August 2, 2024

Hi @Cmirai,

You shouldn’t need to upload the app bundle file every time to test. If the closed test track is already published and approved by Google, then this error typically indicates exactly what the message states - that the product is not available for purchase for the user and device that is being used. This can be because of the country that the user is in, or your current user has not been added as a licensed test user. We’ve also seen this error be thrown if there are too many Google accounts on the device. 


Forum|alt.badge.img
  • Author
  • New Member
  • 1 reply
  • August 2, 2024

Thank you for your response.

However, I don't understand why there would be a difference in the country or user between the app installed from the Play Store and the app built in Debug mode in Visual Studio Code. I am testing using the same device.
I have logged into the Play Store with the account that I added as a test user and installed the app, so it should be automatically logged in with the test user's account? In that case, how do I log in as a test user in Debug mode in Visual Studio Code?
Additionally, how is the country determined? Is it based on the global IP address that the device holds, or is it the country setting in the Android device settings? I apologize for the basic question.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings