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 a test_ Test Store key in a release build.

Fix#

  1. Copy the app's public SDK key again from the app page and check each character.
  2. Set Purchases.proxyURL before Purchases.configure.
  3. Use the iOS app's key in the iOS build and the Android app's key in the Android build.
  4. 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.

Source#

Checked: 2026-10-03

Edit this page on GitHub ↗ View as Markdown Last updated