Question

Flutter: PlatformException(5, The product is not available for purchase.

  • 22 December 2022
  • 3 replies
  • 761 views

Badge +4

Hi,

trying to make use of RevenueCat but I won’t get it to work on Android but only iOS.

I am getting when trying to purchase a product on a simulator and on my Android device with:

try {
       await Purchases.purchaseProduct('test_4weeks_4_extend');
      } catch (e) {
         print(e);
     }

D/[Purchases] - DEBUG(11123): ℹ️ Requesting products from the store with identifiers: test_4weeks_4_extend
D/[Purchases] - DEBUG(11123): ℹ️ Products request finished for test_4weeks_4_extend
I/flutter (11123): PlatformException(5, The product is not available for purchase., {code: 5, message: The product is not available for purchase., readableErrorCode: ProductNotAvailableForPurchaseError, readable_error_code: ProductNotAvailableForPurchaseError, underlyingErrorMessage: Couldn't find product.}, null)

I have followed the complete setup and created the keys and they are successfully on the platform and also connection to Google is working for Developer Connection.

The identifiers are matching the same on Play Store as well as on RevenueCat.

The products are activated on the PlayStore.

My app is on Closed testing and my Google Account is assigned as tester and in license testing.

For me it looks like RevenueCat does not find the product on the PlayStore but I don’t see any way to check that RevenueCat is able to fetch those products.

Any idea?

Thanks

 


3 replies

Badge +4

Did everything from scratch today and following each step with the same result.

Any advise would be appreciated.

 

Thanks

Badge +4

Looks like await Purchases.purchaseProduct('identifier') does not work on Android but iOS.

You need to create a package on RevenueCat and assign the products and then go for await Purchases.purchasePackage(package) and it works.

A bit strange but it works now.

Happy Holidays!

 

Hello Team,
I am trying to purchase product on android. I double check each and everything.

1. I added build on internal testing.
2. I added my self in internal testing.
3. In-App product all product status is active.
4. In revenue cat product's status code is OK.
5. In revenue I created offering..
6. I also checked both play store and revenue cat product ID is matched

I am using code

// getting product await Purchases.configure({ apiKey: APIKeys.google });
const offerings = await Purchases.getOfferings();
setCurrentOffering(offerings.current);

//Purchasing product
const data = await Purchases.purchaseStoreProduct(pkg.product);

This error I am getting below error everything every time.

Purchase error: {"nativeStackAndroid":[],"userInfo":{"userCancelled":false,"code":5,"underlyingErrorMessage":"Error updating purchases. DebugMessage: . ErrorCode: ITEM_UNAVAILABLE.","readableErrorCode":"ProductNotAvailableForPurchaseError","readable_error_code":"ProductNotAvailableForPurchaseError","message":"The product is not available for purchase."},"message":"The product is not available for purchase.","code":"5","userCancelled":false}

Reply