Skip to main content

Troubleshooting — Document Reader SDK

HTTP calls hang with no error, no crash, no logcat output​

Cause: Ktor version conflict. The SDK uses Ktor 2.3.5 internally. Ktor 2.x and 3.x are binary-incompatible on the same classpath and silently deadlock the request pipeline.

Fix:

  1. Use io.yesid:card_detection:0.5.4 or newer
  2. Keep your app on Ktor 2.x
  3. Verify resolved versions:
./gradlew :app:dependencies --configuration releaseRuntimeClasspath | grep ktor

Every io.ktor:* line should read 2.3.5. If any shows 3.x.x, force the resolution:

build.gradle (app)
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == "io.ktor") {
details.useVersion("2.3.5")
}
}
}

Camera never shows — permission screen loops​

Ensure android.permission.CAMERA is declared in your AndroidManifest.xml. The SDK requests it at runtime but the manifest declaration is still required.


OCR returns empty results​

  1. Session expired — check logcat for "Missing Session ID" or "Session error". Create a fresh session.
  2. Poor image quality — ensure adequate lighting and a steady hand.
  3. Unsupported document — check your session's documentsAllowed configuration.

IllegalStateException: License key is empty​

Migrate to the sessions-based flow:

OCRConfigurationBuilder.setSessionID(sessionId)

Duplicate class error at build time​

If you see Duplicate class errors, add exclusions to your build.gradle:

configurations.all {
exclude(group = "org.tensorflow", module = "tensorflow-lite")
exclude(group = "org.tensorflow", module = "tensorflow-lite-support")
}