๐Ÿ›ก๏ธ Error Handling

March 29, 2026 ยท View on GitHub

โ† Back to README

Philosophy, principles, and a complete reference table for all user-facing error messages in Android DEX.


Philosophy

Technical information stays in dev logs. Plain English reaches the user.

Android DEX operates on a strict two-tier messaging system:

TierWho Sees ItContentExample
Dev LogDeveloper (console / logcat)Raw process output, stack traces, exit codes, file paths[JAR STDERR]: java.lang.ClassNotFoundException
User MessageEnd-user (boot screen)Plain-English, actionable, no technical jargon"Service module not found. Please reinstall the application."

This means dev.log() and debugPrint() calls are completely separate from the Stream<AppEvent> and Stream<JarEvent> that drive the UI.


Message Pipeline

Exception thrown anywhere in boot/reconnect
        โ”‚
        โ–ผ
e.toString().replaceFirst('Exception: ', '')
        โ”‚
        โ–ผ
_log(message, isError: true)
        โ”‚
        โ–ผ
Stream<AppEvent> or Stream<JarEvent>
        โ”‚
        โ–ผ
InitScreen / ReconnectingOverlay renders _ErrorBox

Complete Error Message Reference

AdbProvider โ€” ADB & Device Errors

SituationUser-Facing Message
adb.exe not found in install dirADB runtime not found. Please reinstall the application.
AndroidDex.apk not found in install dirCompanion APK is missing from the installation folder. Please reinstall.
androiddex.jar not found in install dirService module not found in the installation folder. Please reinstall.
adb start-server exits with non-zeroADB server failed to start. Close any other ADB instances and retry.
adb connect output doesn't confirm connectionUnable to connect to the device. Verify the IP address or check the USB cable.
adb reverse fails on any portNetwork bridge setup failed on port {N}. The device may have revoked ADB permissions.

JarManager โ€” Logic Engine Errors

SituationUser-Facing Message
Local .jar file missingService module not found. Please reinstall the application.
adb push unsuccessfulCould not transfer service to device. Check connection and try again.
Any exception during startJar()Service initialization failed. Ensure the device is connected.
JAR process exits with non-zero codeService process stopped unexpectedly. Will attempt reconnection.

AppManager โ€” System Init Errors

SituationUser-Facing Message
APK install failsApp installation failed. Check device storage and USB permissions.
am start service launch failsFailed to launch Android service. Try restarting the device.
JAR handshake timeout (15s)Background service timed out. The device may be busy or unreachable.
APK handshake timeout (15s)Companion app timed out. Ensure it is installed and running on the device.
Any uncaught exceptionThe exception message with "Exception: " prefix stripped

ReconnectionManager โ€” Reconnection Errors

SituationUser-Facing Message
Device cleanly disconnected / unreachableDevice disconnected. Check your USB cable or Wi-Fi connection.
Unexpected exception during reconnectReconnection failed unexpectedly. Try restarting the application.

DeviceManagerDialog โ€” IP Connection Errors

SituationUser-Facing Message
IP field empty on Connect tapEnter a valid IP address
adb connect output doesn't confirmUnable to connect to {ip} โ€” verify the IP and try again.
Exception during connectConnection failed โ€” ensure ADB over Wi-Fi is enabled on the device.

InitScreen โ€” Boot State Errors

SituationUser-Facing Message
User cancels device picker with no deviceNo device selected. Connect an Android device

Connection Error Detection

The boot screen uses a heuristic check to decide whether to show the "Open ADB Manager" button after an error:

bool _isConnectionError(String msg) {
  final l = msg.toLowerCase();
  return l.contains('connect')  ||
         l.contains('device')   ||
         l.contains('adb')      ||
         l.contains('network')  ||
         l.contains('refused')  ||
         l.contains('timeout')  ||
         l.contains('unreachable') ||
         l.contains('bridge');
}

If true โ†’ _canPickDevice = true โ†’ the glow button appears below the error box.
If false โ†’ only the error message is shown (e.g., a reinstall-type error wouldn't benefit from the device picker).


Error UI Components

_ErrorBox (Boot Screen)

A red-tinted inline panel below the progress bars:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  โœ–  {error message}                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

_ChooseDeviceButton (Boot Screen โ€” connection errors only)

Appears below _ErrorBox when _canPickDevice == true:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ“ฑ  Open ADB Manager โ€” Select Device         โ”‚  โ† glowing blue border
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Clicking triggers _handleChooseDevice():

  1. Opens DeviceManagerDialog
  2. On device selection โ†’ _resetBootState() โ†’ _runBoot() (clean retry)

โ† Back to README ยท Modules ยป ยท Device Manager ยป