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:
- Use
io.yesid:card_detection:0.5.4or newer - Keep your app on Ktor 2.x
- 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​
- Session expired — check logcat for
"Missing Session ID"or"Session error". Create a fresh session. - Poor image quality — ensure adequate lighting and a steady hand.
- Unsupported document — check your session's
documentsAllowedconfiguration.
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")
}