SDK error · code 19

insufficientPermissionsError (error code 19): Insufficient permissions

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.insufficientPermissionsError

Android (Kotlin)

PurchasesErrorCode.InsufficientPermissionsError

Causes

Why the SDK returns insufficientPermissionsError

  • Android: a SecurityException thrown inside an SDK call is converted to InsufficientPermissionsError, with the exception's message as the error message (errors.kt).
  • Any other SecurityException raised while the SDK runs, for example a call that needs a permission the app does not hold.
  • iOS: the code is in the enum with the description "App does not have sufficient permissions to make purchases", but the iOS SDK source has no place that raises it (ErrorCode.swift).

Fix

How to fix insufficientPermissionsError

  1. 01

    Read the exception message

    On Android, error.underlyingErrorMessage holds the SecurityException text. It usually names the missing permission or the blocked component.

  2. 02

    Check the manifest

    Make sure the app's manifest declares what the SDK and the store need, then rebuild. Compare it with a fresh sample app.

  3. 03

    Reproduce on a clean device

    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.

  4. 04

    Report what you find

    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

How to handle it in code

  • Do not retry. The permission stays missing until you or the device owner fix it.
  • Show "Purchases are not available on this device" and log the exception text with the device model and Android version.
  • Do not grant access.
Match the errorSwift · Kotlin
// 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

insufficientPermissionsError: questions people ask

What causes insufficientPermissionsError on Android?

A SecurityException inside an SDK call. The exception message names the missing permission or blocked component. Read it from underlyingErrorMessage.

Does iOS raise insufficientPermissionsError?

The code exists in the iOS enum, but the iOS SDK source has no path that raises it. iOS reports blocked purchases as purchaseNotAllowedError.

How do I check for insufficientPermissionsError in React Native and Flutter?

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

Keep the RevenueCat SDK. Change the backend.

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