Skip to main content

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/‼️ 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?

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. 


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.