What does StoreKitError.unknown mean?

StoreKitError.unknown is StoreKit 2's catch-all for a failure it has no better name for.

Quick facts#

Error StoreKitError.unknown
Where StoreKit 2, Swift (StoreKitError)
Available since iOS 15.0, iPadOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, visionOS 1.0
What the vendor says An unknown error occurred.

Cause#

  • StoreKit raised an error that none of the other StoreKitError cases describes. Apple gives no cause, and the case carries no underlying error.
  • The RevenueCat SDK source notes that StoreKitError does not conform to CustomNSError as of iOS 15.2, so no extra detail can be read from it (StoreKitError+Extensions.swift).
  • Because nothing more is known, the cause can be a device problem, a store problem or a configuration problem.

Fix#

  1. Log the full error value, the product ID and the iOS version, so repeated cases can be grouped.
  2. Retry once after a short pause, and test on a second device and account.
  3. Check the basics: the device is signed in to the App Store, the product exists in App Store Connect and the app is the build you think it is.
  4. Update to the newest SDK and Xcode, because a case Apple adds later can reach older code as unknown.

Example#

Swift
import StoreKit

// With no detail to read, log everything you have, then show a neutral message.
func buy(_ product: Product) async {
    do {
        _ = try await product.purchase()
    } catch StoreKitError.unknown {
        print("StoreKit unknown error for \(product.id) on \(ProcessInfo.processInfo.operatingSystemVersionString)")
    } catch {
        print("Purchase failed: \(error)")
    }
}

Compile-checked: npm run check:snippets type-checks this snippet with swiftc against the Apple SDK (macOS target, checked 2026-10-03).

How the RevenueDot SDK reports it#

The RevenueDot purchases-ios fork maps StoreKitError.unknown to ErrorCode.storeProblemError (code 2), not to unknownError. See what storeProblemError means and what unknownError means.

Source#

Checked: 2026-10-03

Edit this page on GitHub ↗ View as Markdown Last updated