9. Error Reference
The table below lists all known errors and symptoms, their most likely cause, and the recommended resolution. Match the exception class or symptom you see in logcat to the appropriate row.
Error Table
| Error / Symptom | Likely Cause | Resolution |
|---|---|---|
| IllegalStateException | SDK not initialized | Call getInstance(context, config) |
| InflateException | ConstraintLayout missing | Add constraintlayout dependency |
| UnsupportedDevice | OEM not recognised | Use supported device (HorizonPay or Topwise) |
| Print callback: success=false | Printer overheated or out of paper | Check printer hardware |
| Key exchange: success=false | TMS unreachable or device not registered | Verify network connectivity and device registration on UNISWITCH TMS |
| SecurityException on location | Runtime location permission not granted | Request ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION at runtime |
IllegalStateException — SDK Not Initialized
Symptom
Any SDK method call throws IllegalStateException.
Cause
You called an SDK method before getInstance(), or after destroy() was called, causing the singleton to be null.
Resolution
val pos = OctopusTMS.getInstance(
context = applicationContext,
config = OctopusTMS.Config(
appName = "MyApp",
enableLogs = BuildConfig.DEBUG
)
)
InflateException — ConstraintLayout Missing
Symptom
App crashes on startPayment() with android.view.InflateException: Error inflating class androidx.constraintlayout.widget.ConstraintLayout.
Resolution
// build.gradle.kts
dependencies {
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
}
UnsupportedDevice — OEM Not Recognised
Symptom
initialize() callback returns InitResult.UnsupportedDevice.
Cause
The SDK could not match the hardware to any supported OEM driver. This occurs when running on a device that is not HorizonPay or Topwise, or on an emulator.
Resolution
Use a supported OEM device. New device drivers are added in SDK updates without API changes — contact UNISWITCH for the latest SDK version if your device model is not yet supported.