Solved

[Flutter/iOS] "Platform Exception: Couldn't find product" cannot be resolved


Badge +3
  • New Member
  • 7 replies

 

I get the error in the title when I run the following

await Purchases.purchaseProduct(product.identifier);

I have verified that the Product Id is the same as the one in App Store Connect.
Bank account and taxes are already set up.

What is the problem and how do I fix it?

icon

Best answer by Cesar 31 August 2022, 07:33

View original

29 replies

Userlevel 5
Badge +7

Hi @sal, have you gone through the article below? 

Why are offerings or products empty? | RevenueCat Community

Badge +3

@Jens 

I looked through it. Everything written on it has been addressed.
But it is not resolved.

Userlevel 5
Badge +7

Could you post the whole debug log?

Badge +3

@Jens 

The error is as follows.

flutter: │ 💡 PlatformException(5, Couldn't find product., {underlyingErrorMessage: , userCancelled: false, code: 5, message: Couldn't find product.}, null)

Badge +3

Can confirm you’re not the only one with this issue, I upgraded the RC SDK in my React Native App from v4 to v5, it worked fine before.

Seems to be related to StoreKit2 as it still works on iOS 14 but not on iOS 15

Badge +3
Aug 29 15:39:13 App(libswiftFoundation.dylib)[7104] <Notice>: [Purchases] - INFO: \M-b\M^D\M-9\M-o\M-8\M^O StoreKit 2 support enabled
Aug 29 15:39:17 App(libswiftFoundation.dylib)[7104] <Notice>: [Purchases] - WARN: \M-b\M^Z\240\M-o\M-8\M^O Unknown subscription length for package 'aa-subscriptions': PackageType.custom. Ignoring.
Aug 29 15:39:17 App(libswiftFoundation.dylib)[7104] <Notice>: [Purchases] - WARN: \M-b\M^Z\240\M-o\M-8\M^O Unknown subscription length for package 'aa-subscriptions': PackageType.custom. Ignoring.
Aug 29 15:39:17 App(libswiftFoundation.dylib)[7104] <Notice>: [Purchases] - WARN: \M-b\M^Z\240\M-o\M-8\M^O Unknown subscription length for package 'aa-subscriptions': PackageType.custom. Ignoring.

Debug Logs

Userlevel 5
Badge +8

@Josh 

Those particular lines in the log are safe to ignore (we’ll update them to make them clearer), all they’re stating is that you have a package with custom duration. 

 

@Josh and @sal 

Could you provide more logs? There should be something there that specifically calls out which products can’t be found or whether there’s a credentials issue. 

Badge +3

@Jens @Andy 

Do in-app purchases have to be on the Test flight?

Userlevel 5
Badge +8

You should be able to test while developing locally, no need for TestFlight. 

If you’re developing locally: 

You can make purchases on physical devices, but simulators won’t work. This is referred to as the Sandbox environment.  

 

You can make purchases on a simulator by using StoreKit Configuration files. Those require a little more setup, but provide a bit more flexibility. 

 

Here are our docs on testing, which will help you get set up. https://docs.revenuecat.com/docs/apple-app-store

Badge +3

Found this issue on GitHub too, no updates since a week

https://github.com/RevenueCat/react-native-purchases/issues/402

Anyway I have attached the full debug log containing App start up to purchase error.

Badge +3

@Andy  @Jens 

I will share more detailed logs.

Badge +3

@Andy @Jens 

Is it necessary to do what is written on the following pages?

https://docs.revenuecat.com/docs/in-app-purchase-key-configuration

Userlevel 5
Badge +7

Hi @sal , In-App Purchase Key Configuration is required only if you want to create iOS Subscription Offers (a special kind of discounted offering), so very likely the answer is no. 

I will let @Andy have a look at the log because that’s a bit outside of my area of expertise :) 

Badge +3

@Andy @Jens 

Thanks for all the comments.

I found out some new facts.

This did not work.

await Purchases.purchaseProduct(product.identifier);

But the following succeeded!

 await Purchases.purchasePackage(package);

What is the difference between these two methods?

Userlevel 3
Badge +3

They should behave very similarly. When purchasing a package, we will trigger a purchase for the product that’s associated with the product. Can you confirm the `product.identifier` you are passing to `purchaseProduct` is the same as `package.storeProduct.identifier` being `package` the one you’re passing to `purchasePackage`? If they are different then there’s something wrong with that product you are passing to `purchaseProduct`
 

Badge +1

We actually have exact same issue; after upgrading purchases_flutter to 4.2.0 we’re getting “2022-08-31 01:01:07.047514+0300 Runner[94560:6169725] flutter: PlatformException(5, Couldn't find product., {message: Couldn't find product., userCancelled: false, code: 5, underlyingErrorMessage: }, null)” error when we try to purchase a product that defined in both Apple and Revenuecat with exact same name. Do you have any idea about that? Also apple purchase window not showing up because of this error.

Userlevel 3
Badge +3

Can you please set `usesStoreKit2IfAvailable` to false in your `PurchasesConfiguration` object and let us know if that solves the issues? If you are using the old `setup` function, you can pass `usesStoreKit2IfAvailable` as false to the function.

Userlevel 3
Badge +3

Ok, little update here… I’ve managed to reproduce it with `purchaseProduct` and with sk2 enabled. Setting `usesStoreKit2IfAvailable`  to false when configuring the SDK via the `PurchasesConfiguration` or `setup` function fix it.

We are looking into what could be causing this problem.

Userlevel 3
Badge +3

We have identified the issue and are working on a fix for it.

Userlevel 3
Badge +3

Version of purchases-flutter 4.2.1 has the fix for this issue. Please let us know if you experience more problems.

Badge +3

@Cesar 

In ver 4.2.1, I was able to process the purchase with `purchaseProduct`.
Thanks for the fix.

Badge +1

Can you please set `usesStoreKit2IfAvailable` to false in your `PurchasesConfiguration` object and let us know if that solves the issues? If you are using the old `setup` function, you can pass `usesStoreKit2IfAvailable` as false to the function.

Thank you so much Cesar, we have solved this problem with this solution.

Have a great day!

Badge

Hi, I am still facing the same issue even though I am using updated version 4.3.0.
Even tried on 4.2.1 and set the Sk2 to false but no luck.

p.s: I have already verified that I am using same product ids and everything.

Badge +2

having the same experience as Syed

(iOS 15.4 (physical device), Flutter v2.10.1, purchases_flutter: 4.2.1 and 4.3.0, AppStore Connect)

→ ProductIDs match RevCat & App Store Connect, config includes setting usesStoreKit2IfAvailable to false

→ In-App Purchases/Subscriptions status is Ready to Submit

→ Paid Apps Agreement Signed

→ Also tried making a new productID

→ NOT using a StoreKit Configuration File

→ API keys added, SDK configured.

@sal and @Turan Gurler is setting usesStoreKit2IfAvailable to false all you did? Are you all on a newer version of Flutter?

I also tried logging in on a new user account with a new appUserId for the SDK.

ALSO, adding my own Store Kit Configuration in Xcode did let me call the iOS purchase sheet but not sure if adding that config has an impact on the RevCat side.

 

Badge +2

having the same experience as Syed

(iOS 15.4 (physical device), Flutter v2.10.1, purchases_flutter: 4.2.1 and 4.3.0, AppStore Connect)

→ ProductIDs match RevCat & App Store Connect, config includes setting usesStoreKit2IfAvailable to false

→ In-App Purchases/Subscriptions status is Ready to Submit

→ Paid Apps Agreement Signed

→ Also tried making a new productID

→ NOT using a StoreKit Configuration File

→ API keys added, SDK configured.

@sal and @Turan Gurler is setting usesStoreKit2IfAvailable to false all you did? Are you all on a newer version of Flutter?

I also tried logging in on a new user account with a new appUserId for the SDK.

ALSO, adding my own Store Kit Configuration in Xcode did let me call the iOS purchase sheet but not sure if adding that config has an impact on the RevCat side.

 

UPDATE -_- working now… already had signed the Paid Apps Agreement and filled out my banking info -- BUT my banking info was still in the “processing” state so just had to wait overnight.

Reply