What does invalidCredentialsError (code 11) mean in the purchases SDK?
The purchases SDK raises invalidCredentialsError (code 11) when the backend rejects the API key or an auth token.
Quick facts#
| Error | ErrorCode.invalidCredentialsError (iOS), PurchasesErrorCode.InvalidCredentialsError (Android), code 11 |
| Where | Purchases SDK (iOS, Android and the hybrid SDKs built on them) |
| What the vendor says | There was a credentials issue. Check the underlying error for more details. |
Cause#
- The backend answered 7225 (invalid API key) or 7224 (invalid auth token). iOS also maps 7104 (invalid App Store shared secret) and 7981, and Android maps 7107 (invalid Play Store credentials).
- The key has a typo, or it belongs to another project or another server; a RevenueCat key sent to RevenueDot is unknown, and the reverse.
- The proxy URL was set after
configure, or the key is of the wrong kind, such as atest_Test Store key in a release build.
Fix#
- Copy the app's public SDK key again from the app page and check each character.
- Set
Purchases.proxyURLbeforePurchases.configure. - Use the iOS app's key in the iOS build and the Android app's key in the Android build.
- On iOS,
PurchasesDiagnostics.default.testSDKHealth()reports an invalid API key as such.
Example#
Swift
// The purchases SDK throws `ErrorCode` values; match the one you handle and let the rest fall through.
func handle(_ error: Error) {
guard let code = error as? ErrorCode else {
print("Not a purchases SDK error: \(error)")
return
}
switch code {
case .invalidCredentialsError:
// The key stays wrong until you fix it: alert yourself, show customers a generic message.
print("The API key was rejected")
default:
print("Other purchases error: \(code.description)")
}
}Compile-checked: npm run check:snippets type-checks this snippet with swiftc together with the ErrorCode.swift file of the RevenueDot purchases-ios fork (checked 2026-10-03).
How the RevenueDot SDK reports it#
RevenueDot answers 401 with code 7225 for an unknown key. See the server error codes. Deep dive: revenuedot.app/errors/invalid-credentials-error.
Related#
- What does configurationError (code 23) mean in the purchases SDK?
- What does invalidReceiptError (code 8) mean in the purchases SDK?
- What does networkError (code 10) mean in the purchases SDK?
- What RevenueDot's API errors mean (server codes)
Source#
- RevenueDot purchases-ios: ErrorCode.swift (the iOS ErrorCode enum)
- RevenueDot purchases-android: PurchasesErrorCode.kt (the Android enum)
- RevenueDot purchases-ios: BackendErrorCode.swift (backend code mapping)
- RevenueDot purchases-android: common/errors.kt (backend code mapping)
Checked: 2026-10-03