Skip to main content

Error handling

All error handling for the Android SDK is centralized in this section. The onErrorAcessoBio callback receives an ErrorBio object with code and description.

Error codes
CodeDefault messageWhen it occursRecommended handling
AUTH_FAILEDSDK authentication failedInvalid or expired SDK KeyValidate credentials with the Onboarding team
CAMERA_PERMISSION_DENIEDCamera permission deniedUser denied camera permissionDirect the user to app settings
LIVENESS_FAILEDLiveness check failedImage did not pass liveness validationRequest a new capture
NETWORK_ERRORNetwork error during captureInsufficient connectivityRequest reconnection
SDK_NOT_INITIALIZEDSDK not initializedCapture called before initEnsure init is called in Application/onCreate
SDK error codes

The codes above cover the primary SDK callback errors. REST API error codes (HTTP status families) are documented separately at API Reference > Error codes.

Handling the callback
override fun onErrorAcessoBio(error: ErrorBio) {
when (error.code) {
"AUTH_FAILED" -> { /* handle authentication failure */ }
"CAMERA_PERMISSION_DENIED" -> { /* redirect to app settings */ }
"LIVENESS_FAILED" -> { /* prompt the user to try again */ }
else -> { /* generic error handling */ }
}
}
Lifecycle callbacks

In addition to onErrorAcessoBio, the SDK also triggers:

  • onUserClosedCameraManually() — user closed the camera manually.
  • onSystemClosedCameraTimeoutSession() — session expired due to timeout.
  • onSystemChangedTypeCameraTimeoutFaceInference() — no face detected for 13 seconds; the SDK switches to manual capture.