---
title: エラーハンドリング
canonical: https://developer.unico.io/ja/dual-api/developers/sdks-and-tools/android/error-handling
locale: ja
generated_by: markdown-export
---

Android SDK のすべてのエラーハンドリングはこのセクションに集約されています。`onErrorAcessoBio` コールバックは `code` (Int) と `description` (String) を持つ `ErrorBio` オブジェクトを受け取ります。

## コールバックの処理

### Kotlin

  ```kotlin
  override fun onErrorAcessoBio(error: ErrorBio) {
    when (error.code) {
      73002 -> { /* camera permission denied — redirect to app settings */ }
      73006 -> { /* running on emulator — physical device required */ }
      73100 -> { /* no internet connection */ }
      else -> { /* generic error handling */ }
    }
  }
  ```

### Java

  ```java
  @Override
  public void onErrorAcessoBio(ErrorBio error) {
    switch (error.getCode()) {
      case 73002: /* camera permission denied — redirect to app settings */ break;
      case 73006: /* running on emulator — physical device required */ break;
      case 73100: /* no internet connection */ break;
      default: /* generic error handling */
    }
  }
  ```

## ライフサイクルコールバック

`onErrorAcessoBio` に加えて、SDK は以下もトリガーします：

- `onUserClosedCameraManually()` — ユーザーが手動でカメラを閉じた。
- `onSystemClosedCameraTimeoutSession()` — タイムアウトによりセッションが終了した。
- `onSystemChangedTypeCameraTimeoutFaceInference()` — 13 秒間顔が検出されなかった場合、SDK が手動キャプチャーに切り替わります。

## エラーコード

すべてのエラーコードは `UnicoException` enum から発生し、`ErrorBio(code, message)` を通じて渡されます。`message` フィールドには SDK の正確な文字列が含まれます — 変更したりローカライズしたりしないでください。

| コード | メッセージ | 説明 |
|---|---|---|
| `73001` | `Context invalid` | SDK に渡された Android コンテキストが無効 |
| `73002` | `Did not grant permission to open camera` | ユーザーがカメラの権限を拒否した |
| `73003` | `The lest API is 21(LOLLIPOP` | デバイスの API レベルが最小要件 (API 21) 未満 |
| `73004` | `Could not find implementation interface callback iAcessoBioSelfie` | `iAcessoBioSelfie` インターフェースが実装されていない |
| `73005` | `Could not find implementation interface callback iAcessoBioDocument` | `iAcessoBioDocument` インターフェースが実装されていない |
| `73006` | `Unable to open camera on emulators` | SDK はエミュレーターで動作しません — 実機を使用してください |
| `73007` | `Unknown and unexpected error in WebApp…` | WebApp の一般的なエラー（カメラ、ストレージ、セキュリティ、ネットワーク） |
| `73100` | `Unable to connect to internet.` | インターネット接続がありません |
| `73200` | `Please inform the config object or json file name` | 設定オブジェクトまたは JSON ファイルが指定されていない |
| `73202` | `Unable to parse json file` | JSON 設定ファイルが破損しています |
| `73204` | `Unable to initialize the SDK, please configure the environment on setEnviroment method of build` | 初期化前に `setEnvironment()` が呼び出されていない |
| `73300` | `Unable to get unico authentication object` | 認証オブジェクトの取得に失敗 |
| `73301` | `Unable to parse object` | 認証レスポンスの解析に失敗 |
| `73302` | `Could not find the unico token` | Unico 認証トークンが見つからない |
| `73303` | `Current host is not registered` | バンドル識別子が SDK Key に登録されていない |
| `73400` | `Could not initialize camera` | カメラの初期化に失敗 |
| `73701` | `Could not find active liveness import` | アクティブライブネスモジュールが見つからない |
| `73703` | `Unable to get active liveness session` | ライブネスセッションの取得に失敗 |
| `73718` | `The Session was cancelled because of an unknown and unexpected error…` | 不明な内部セッションエラー |
| `73721` | `The Session can't be performed: attempts limit exceeded.` | セッションがキャンセルされた — キャプチャ試行回数の上限を超えました |
| `73722` | `The Session can't be performed: face alignment timeout.` | セッションがキャンセルされた — 顔の位置合わせがタイムアウトしました |
| `73726` | `An error happened during video recording` | ライブネス中の動画録画エラー |
| `73727` | `No actions found in a video` | 動画でライブネスアクションが検出されなかった |
| `73740` | `The user pressed the do not consent button and did not complete the Session.` | ユーザーが同意を拒否した |
| `73800` | `Could not build encrypted key.` | 暗号化 JWT の構築に失敗 |
| `73801` | `The Session of SDK was cancelled because of an unknown and unexpected error.` | 不明な内部 SDK セッションエラー |
| `73802` | `The Session was cancelled because of an unknown and unexpected error…` | セッションがキャンセルされた — 必須 JWT フィールドが欠如 |
| `73900` | `Erro ao analisar imagem` | キャプチャ画像の解析中にエラーが発生した |
| `73901` | `É necessário implementar a interface AcessoBioListener` | `AcessoBioListener` インターフェースが実装されていない |
| `73902` | `É necessário insirir um valor maior que 40 segundos no método: setTimeoutSession.` | `setTimeoutSession` の値は 40 秒より大きくなければならない |
| `73903` | `Arquivo de configuração corrompido. Verifique o arquivo json e tente novamente.` | 設定ファイルが破損しています — 確認して再試行してください |
| `73904` | `Erro ao finalizar processo` | キャプチャプロセスの完了中にエラーが発生した |
| `73905` | `Unable to open document camera` | ドキュメントカメラを開けなかった |
| `73906` | `Document type uninformed` | ドキュメントタイプが指定されていない |
| `74001` | `onSuccess: not implemented when using open:webAppToken:` | ユーザージャーニー用の `onSuccess` コールバックが実装されていない |
| `74100` | `Could not prepare SDK-S` | SDK コンポーネントの準備に失敗 |
| `74101` | `No URL token was provided.` | ジャーニー用の URL トークンが指定されていない |
| `74102` | `Environment type was not specified.` | Environment (`PROD`/`UAT`) が設定されていない |
| `737120` | `Unable to initialize liveness` | ライブネスアクティビティを初期化できなかった |
| `737220` | `Capture could not start` | キャプチャプロセスを開始できなかった |
| `737320` | `Transaction could not start` | トランザクションを開始できなかった |
| `737321` | `The Session was cancelled because of an unknown and unexpected error. This return value is a catch-all for errors experienced during normal usage of these APIs. Try again.` | セッションプロバイダーの一般的なエラー — 再試行してください |

:::secondary[REST API エラーコード]
上記のコードは SDK コールバックエラーです。REST API エラーコード（HTTP ステータスファミリー）は [API リファレンス > エラーコード](/dual-api/developers/api-reference/error-codes) に別途記載されています。
:::