Skip to main content

Error handling

All error handling for the Flutter SDK is centralized in this section. The onErrorUnico, onErrorSelfie, and onErrorDocument callbacks receive a UnicoError object exposing getCode() and getDescription().

Error codes
CodeDescription
73001Context invalid
73002Did not grant permission to open camera
73003The least API is 21 (LOLLIPOP)
73004Could not find implementation interface callback iAcessoBioSelfie
73005Could not find implementation interface callback iAcessoBioDocument
73006Unable to open camera on emulators
73100Unable to connect to internet
73200Please inform the JSON file name
73202Unable to parse JSON file
73300Unable to get unico authentication object
73301Unable to parse object
73302Could not find the unico token
73303Current host is not registered
73400Could not initialize camera
73500Unable to get session token — service response error
73501Unable to parse object
73502Could not get session token
73701Could not find active liveness import
73702Unable to initialize active liveness in production mode
73703Unable to get active liveness session
73704The user pressed the cancel button and did not complete the session
73705The session was not performed successfully and a FaceScan was not generated
73706Camera access denied — user explicitly denied permission or device policy blocks it
73707The session was cancelled due to the app being terminated, sleeping, OS notification, or backgrounded
73708The session was cancelled because the device is in landscape mode
73709The session was cancelled because the device is in reverse portrait mode
73710The session was cancelled because the user was unable to complete it within the allotted timeout
73712The session was cancelled due to memory pressure / app not in production requires network
73713The session was cancelled because your key needs to be validated again
73714The session was cancelled because the developer-configured encryption key was not valid
73715The session was cancelled because not all guidance images were configured
73716The session was cancelled because the SDK was unable to start the camera on this device
73717The session was cancelled because the user was in a locked-out state
73718Unknown and unexpected error during normal usage of native APIs
73719The session was cancelled because the user pressed the Get Ready screen subtext message
73800Could not build encrypted key
Official error catalog

The codes above reflect the Flutter SDK catalog. The official cross-platform error code catalog is available at API Reference > Error codes.

Handling the callback
@override
void onErrorUnico(UnicoError error) {
final code = error.getCode();
final description = error.getDescription();
// handle error
}
Lifecycle callbacks

In addition to onErrorUnico, the SDK also triggers:

  • onUserClosedCameraManually() — user closed the camera manually.
  • onSystemClosedCameraTimeoutSession() — session expired due to timeout (default 40 s, minimum 40 s).
  • onSystemChangedTypeCameraTimeoutFaceInference() — face detection exceeded the 13 s threshold; capture switches to manual mode.