Code
11
SDK error · code 11
What it means
invalidCredentialsError (code 11) means the backend rejected the SDK's API key or an auth token as invalid, usually backend code 7225 (invalid API key) or 7224 (invalid auth token). Every call fails until the key is right. Copy the app's public SDK key again, check it belongs to the server the SDK talks to, and set the proxy URL before configure.
Code
11
iOS (Swift)
ErrorCode.invalid
Android (Kotlin)
PurchasesErrorCode.Invalid
Causes
configure, so the first requests went to the wrong host with this key.test_ Test Store key in a release build, or a key from a different platform's app.| Backend code | Meaning |
|---|---|
| 7225 | Invalid API key. |
| 7224 | Invalid auth token. |
| 7104 | Invalid App Store shared secret (iOS mapping). |
| 7981 | Invalid IAM token (iOS mapping). |
| 7107 | Invalid Play Store credentials (Android mapping). |
Fix
Copy the app's public SDK key from the app page, or call GET /v2/projects/{project_id}/apps/{app_id}/public_api_keys with your secret key. Check each character.
Set Purchases.proxyURL before Purchases.configure. See the SDK guides.
Use the iOS app's key in the iOS build and the Android app's key in the Android build. Ship store keys in release builds and test_ keys only in development builds.
On iOS, PurchasesDiagnostics.default.testSDKHealth() maps this error to an "invalid API key" result, which confirms the key is the problem.
In your app
// Swift
do {
let result = try await Purchases.shared.purchase(package: package)
} catch let error as ErrorCode where error == .invalidCredentialsError {
// handle invalid credentials
}
// Kotlin
if (error.code == PurchasesErrorCode.InvalidCredentialsError) { /* ... */ } On RevenueDot: RevenueDot answers HTTP 401 with code 7225 and the message "Invalid API Key." when the Authorization: Bearer key is missing or unknown. A subscriber access token (rdat_) that has expired, or that names another app user ID, gets 401 with 7224. The health endpoints need no key. See common problems.
FAQ
Backend code 7225 means the API key is invalid. The SDK reports it as invalidCredentialsError (code 11). Check the key, the project and the proxy URL.
The key is from a different server, or the proxy URL was set after configure. Use the public key of an app in your RevenueDot project and set the proxy URL first.
In React Native, compare error.code with PURCHASES_ERROR_CODE.INVALID_CREDENTIALS_ERROR. In Flutter, convert the PlatformException with PurchasesErrorHelper.getErrorCode(e) and compare the result with PurchasesErrorCode.invalidCredentialsError.
Get started
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