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
StoreKitErrorcases describes. Apple gives no cause, and the case carries no underlying error. - The RevenueCat SDK source notes that
StoreKitErrordoes not conform toCustomNSErroras 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#
- Log the full error value, the product ID and the iOS version, so repeated cases can be grouped.
- Retry once after a short pause, and test on a second device and account.
- 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.
- 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.
Related#
- What does storeProblemError (code 2) mean in the purchases SDK?
- What does StoreKitError.systemError mean?
- What does unknownError (code 0) mean in the purchases SDK?
Source#
- Apple: StoreKitError.unknown
- RevenueDot purchases-ios: StoreKitError+Extensions.swift (how the SDK maps StoreKit 2 errors)
Checked: 2026-10-03