Solved

Receipt files missing in simulator testing

  • 5 November 2021
  • 11 replies
  • 526 views

Badge +3

Hi, I’m testing payments in my app. This has been working for several months as expected. Today however, when testing subscriptions in the iOS simulator I receive an error on `.purchasePackage` and `.restoreTransactions` saying this: `[Error: The receipt is missing.]` 

 

I’ve correctly included my StoreKit configuration in my build, and this was always previously working as expected. I recently upgraded to the new mac, and therefore the latest macOS.

 

Here is what i’m passing into `.purchasePackage`:

{"identifier": "$rc_monthly", "offeringIdentifier": "Full Access", "packageType": "MONTHLY", "product": {"currency_code": "USD", "description": "", "discounts": [], "identifier": "1MONTH", "introPrice": {"cycles": 1, "period": "P2W", "periodNumberOfUnits": 2, "periodUnit": "WEEK", "price": 0, "priceString": "$0.00"}, "intro_price": 0, "intro_price_cycles": 1, "intro_price_period": "P2W", "intro_price_period_number_of_units": 2, "intro_price_period_unit": "WEEK", "intro_price_string": "$0.00", "price": 18.989999771118164, "price_string": "$18.99", "title": ""}}

 

Anyone experiencing this issue?

icon

Best answer by prgm 11 November 2021, 18:05

View original

11 replies

Userlevel 5
Badge +9

Can you try creating a new sandbox user in App Store Connect and see if that fixes it? I think there could be an issue with sandbox accounts that had old purchases, then purchased again on newer operating system.

Badge +3

I’ve done that and it didn’t seem to help. Also i thought sandbox users weren’t needed for simulator testing?

Userlevel 5
Badge +9

Sandbox users are still required for simulator testing, you should be prompted to log in still. Simulators have historically been so unreliable for testing in-app purchases we always recommend testing on a physical device to rule out any simulator issues. Are things working for you on a physical device? 

Badge +3

Ahh, so im not being prompted to login so i assume thats the issue. I’ll test on my physical device now.

Badge +5

One of our engineers is facing this same issue after setting up the project in a M1 Mac. We had understood that purchases in iOS simulators through StoreKit testing didn't involve sandbox users, is there any documentation that explains this relationship?

What is particularly weird in this "missing receipt" error that is happening with one of our engineers is that the error doesn't occur with any other engineer, even though all engineers are using M1 Macs with the same specs and have set up the our project using the same setup scripts. We've already confirmed that the configuration of RevenueCat + StoreKit testing is correctly done in the engineer's machine and we are running out of ideas on how to fix this issue.

The purchase works correctly when the engineer purchases on a physical device, but that is done using a sandbox user and not through StoreKit testing.

Are there any suggestion on what could be happening for this specific engineer? We really appreciate any suggestions.

Thanks!

Badge +1

I am having the same problem while using Storekit on simulator, on device it works no problems. I get 

Error Domain=RevenueCat.ErrorCode Code=9 "The receipt is missing." UserInfo={source_file=RevenueCat/PurchasesOrchestrator.swift:476, NSLocalizedDescription=The receipt is missing., source_function=handlePurchasedTransaction(_:), readable_error_code=MISSING_RECEIPT_FILE}

This was working a few days ago on the same machine with the same simulator

Badge +1

Forgot to mention that I restored Revenuecat back to 4.3.0 (version that was working) and went back to my git commits on the version that worked and still nothing. I tried a different simulator and it was still the same error

Badge +3

Same for me and there is no solution for it.

Badge +3

Apple can't test my app because of this error and I got my 3rd rejection. Is there any solution?

Badge +3

Also seeing this issue @ryan - everything works fine for us when testing in simulator and real devices, but failing for Apple review team with the following error.

The code that is throwing the error is:

await Purchases.purchasePackage(product!.monthly!);
await purchasesService.refreshPurchases();

Any help here would be much appreciated! Have gone through many failed app store reviews now 😅

 

Cheers,

James

 

Badge +3

Oh and we’re using the Flutter SDK client!

Reply