Code
19
SDK error · code 19
What it means
insufficientPermissionsError (code 19) means the app was not allowed to do what it asked. On Android the SDK raises it when a call throws a SecurityException. The iOS SDK defines the code but nothing in its source raises it. Read the exception message in underlyingErrorMessage to see which permission is missing, fix the manifest or device policy, and do not grant access.
Code
19
iOS (Swift)
ErrorCode.insufficient
Android (Kotlin)
PurchasesErrorCode.Insufficient
Causes
SecurityException thrown inside an SDK call is converted to InsufficientPermissionsError, with the exception's message as the error message (errors.kt).SecurityException raised while the SDK runs, for example a call that needs a permission the app does not hold.Fix
On Android, error.underlyingErrorMessage holds the SecurityException text. It usually names the missing permission or the blocked component.
Make sure the app's manifest declares what the SDK and the store need, then rebuild. Compare it with a fresh sample app.
Try a plain emulator image or a personal device. If it works there, the cause is something specific to the failing device, such as a managed profile.
If the message points at the SDK itself, open an issue with the exception text, the SDK version and the device model.
In your app
// Swift
do {
let result = try await Purchases.shared.purchase(package: package)
} catch let error as ErrorCode where error == .insufficientPermissionsError {
// handle insufficient permissions
}
// Kotlin
if (error.code == PurchasesErrorCode.InsufficientPermissionsError) { /* ... */ } FAQ
A SecurityException inside an SDK call. The exception message names the missing permission or blocked component. Read it from underlyingErrorMessage.
The code exists in the iOS enum, but the iOS SDK source has no path that raises it. iOS reports blocked purchases as purchaseNotAllowedError.
In React Native, compare error.code with PURCHASES_ERROR_CODE.INSUFFICIENT_PERMISSIONS_ERROR. In Flutter, convert the PlatformException with PurchasesErrorHelper.getErrorCode(e) and compare the result with PurchasesErrorCode.insufficientPermissionsError.
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