SDK error · code 9

missingReceiptFileError (error code 9): Missing receipt file

What it means

missingReceiptFileError (code 9) means the StoreKit 1 code path found no App Store receipt on the device. It appears on restore or sync when the device has no purchase history yet, often in the sandbox, and when a promotional offer needs a receipt. The default StoreKit 2 mode does not need a receipt file. Make a purchase or sign in to a sandbox account, then restore again.

Code

9

iOS (Swift)

ErrorCode.missingReceiptFileError

Android (Kotlin)

PurchasesErrorCode.MissingReceiptFileError

Causes

Why the SDK returns missingReceiptFileError

  • StoreKit 1 restore or sync: the receipt fetcher returned no data, so the SDK completes with this error instead of posting anything (PurchasesOrchestrator.swift). RevenueCat describes it as no receipt file available on the device (RevenueCat error list).
  • A device with no purchase history, which is common on a fresh install, a new sandbox account or a simulator. Apple exposes the receipt location as Bundle.appStoreReceiptURL, and the file may not exist yet.
  • StoreKit 1 promotional offers: the SDK needs an existing receipt. With none, it returns ineligibleError and carries this error as the underlying error.
  • The app forces StoreKit 1. The SDK's default is StoreKit 2, which reads signed transactions and needs no receipt file.
  • The Android SDK has no receipt file, so Android never raises this error even though its enum lists it.

Fix

How to fix missingReceiptFileError

  1. 01

    Prefer StoreKit 2

    Leave the SDK on its default StoreKit 2 mode unless you have a reason to force StoreKit 1. Then there is no receipt file to miss.

  2. 02

    Buy something first on a test account

    In the sandbox, make one sandbox purchase on the device before you test restore. A device with no purchase has nothing to restore.

  3. 03

    Call restore from a button

    Let the customer tap Restore purchases. On iOS this may ask them to sign in to their Apple account, which can refresh the receipt. See how to restore purchases.

  4. 04

    Treat it as "nothing to restore"

    For a new customer, show "No purchases found on this device" instead of an error.

In your app

How to handle it in code

  • Retrying right away will not help. Retry after a purchase or after the customer signs in to the store account.
  • Show "We could not find any purchases on this device", not a failure message. For a new customer this is the normal answer.
  • Do not grant access. There is nothing to verify.
Match the errorSwift · Kotlin
// Swift
do {
  let result = try await Purchases.shared.purchase(package: package)
} catch let error as ErrorCode where error == .missingReceiptFileError {
  // handle missing receipt file
}

// Kotlin
if (error.code == PurchasesErrorCode.MissingReceiptFileError) { /* ... */ }

On RevenueDot: RevenueDot never sees this error, because the SDK raises it on the device before it sends a request. RevenueDot verifies StoreKit 2 signed transactions directly, and it needs the app's In-App Purchase key only for StoreKit 1 receipts.

FAQ

missingReceiptFileError: questions people ask

Why do I get missingReceiptFileError when I restore purchases?

The StoreKit 1 path found no receipt on the device. That happens when the device has no purchase history, which is normal for a new sandbox account. Buy once on the account or use the default StoreKit 2 mode.

Does the missing receipt error mean my app is broken?

No. It means there is nothing to post yet. Treat it as an empty restore, and test again after a real or sandbox purchase.

How do I check for missingReceiptFileError in React Native and Flutter?

In React Native, compare error.code with PURCHASES_ERROR_CODE.MISSING_RECEIPT_FILE_ERROR. In Flutter, convert the PlatformException with PurchasesErrorHelper.getErrorCode(e) and compare the result with PurchasesErrorCode.missingReceiptFileError.

Get started

Keep the RevenueCat SDK. Change the backend.

RevenueDot answers the same SDK calls with the same error codes. Start free on RevenueDot Cloud, free up to $10,000 a month in tracked revenue.

Already have an account? Sign in · Prefer your own servers? Self-host free