Troubleshooting & Diagnostics
When encountering issues, first identify which stage failed: installation, build & packaging, device connection, runtime startup, or interaction.
1. Installation & Command Problems
Section titled “1. Installation & Command Problems”| Symptom | Checks and Next Action |
|---|---|
zkite is not found |
Use the environment’s explicit executable path (.venv/bin/zkite or .\.venv\Scripts\zkite.exe); verify installation with that environment’s pip. |
| No matching distribution | Verify CPython 3.14, 64-bit architecture (x86_64), and that your wheel matches your host OS. |
| Wrong release runs | Compare zkite --version with python -m pip show zkite zkite-framework zkite-payload. Inspect which executable your shell resolves. |
| Payload missing | Install the complete zkite distribution; do not copy only the CLI executable elsewhere without its payload dependencies. |
| Python version mismatch | Ensure CPython 3.14 is active. Recreate the virtual environment if necessary and verify with zkite doctor. |
| PowerShell activation blocked | Run .venv\Scripts\python.exe and .\.venv\Scripts\zkite.exe directly without calling Activate.ps1. |
2. Build & Packaging Problems
Section titled “2. Build & Packaging Problems”| Symptom | Checks and Next Action |
|---|---|
No project or no main.py |
Run commands from the project directory containing app.json and main.py. |
| Dependency cannot be resolved | Inspect the named dependency in requirements.txt or pyproject.toml; verify pure-Python Android compatibility. |
| Module missing only in the app | Check declared dependencies and top-level helper .py files; try --no-prune-stdlib for dynamic imports. |
| Local image missing | Verify format (PNG/JPEG), relative path (assets/images/logo.png or root), and explicit layout dimensions (w-24 h-24). |
| Remote HTTPS image missing | Ensure "permissions": ["INTERNET"] in app.json, valid HTTPS URL with TLS, and file size under 2 MiB. |
| Nested Python module missing | Automatic staging packages top-level .py files and assets/. Other nested application packages are not automatically staged. |
| Stale or unpinned dependency in dev | Stop dev, delete .zkite/dev-dependencies/, and restart zkite dev to force fresh package resolution. |
| App icon did not change | Check android.icon in app.json, verify real square PNG, and restart zkite dev or rerun zkite run. |
AAB will not install with adb |
An AAB is for Google Play distribution. Build an APK (zkite build apk) for direct adb install. |
3. Device & Connection Problems
Section titled “3. Device & Connection Problems”| Symptom | Checks and Next Action |
|---|---|
| Unauthorized device | Unlock the phone screen and accept the USB debugging authorization prompt. |
| Multiple devices, no selection | In an interactive terminal, use arrow keys; in scripts or CI, pass --serial <SERIAL>. |
| Wrong device chosen | Inspect explicit --serial and ANDROID_SERIAL; an explicit --serial takes precedence. |
| Update rejected by Android | Compare package ID, signing key, SDK, architecture, and version code. Never decrease version_code. |
| Signature mismatch | Locate the original signing key; a new random key cannot update an app signed with another identity. |
| App appears twice in launcher | Distinguish the development preview (with dev label) from the standalone app. |
Do Not Blindly Uninstall
Do not automatically uninstall an existing app to hide an update failure. Uninstalling erases local user data and SQLite databases. Decide whether the installation is disposable before choosing that recovery path.
4. UI & Rendering Problems
Section titled “4. UI & Rendering Problems”| Symptom | Checks and Next Action |
|---|---|
| Text label is missing | Check the class-string-first constructor convention: Text("text-white text-base", "Label"). |
| UI freezes during a request | Move blocking I/O into a module-level Task started from an event; avoid running network/file operations on the UI thread. |
| Text needs truncation / overflow | Constrain its width (e.g. flex-1, w-full) and use multiline=False or max_lines, with overflow="ellipsis". |
| State changes but screen does not | Always use store.update(field=value) to trigger observer notifications. |
| Text input resets while typing | Ensure the field’s value is connected to a store and maintain a stable key. |
| Screen does not scroll | Bound the scrolling region using flex-1, and check intermediate parents for min-h-0. |
| List rows overlap or clip | Verify fixed item_height against actual row content. |
| Select will not open or close | If open is explicit, update it in the corresponding callbacks. |
| Exit animation is invisible | Keep the widget present until its animation completion handler executes. |
| Top or bottom bar stays white | Wrap root screen in SystemBars and provide supported hex colors. |
| Icon contrast is poor | light and dark refer to icons, not backgrounds. Use status_icons="auto" or test explicit choices. |
| Blank screen after resume | Verify lifecycle handlers; inspect device logs with zkite run --logs. |
5. Device Services, Media & Deep Link Problems (Updated in 1.2.1)
Section titled “5. Device Services, Media & Deep Link Problems (Updated in 1.2.1)”| Symptom / Error | Checks and Next Action |
|---|---|
PermissionDenied exception |
The user denied runtime consent when prompted. Check with try/except PermissionDenied and explain the permission in your UI. |
PermissionNotDeclared exception |
The static scanner could not detect a dynamic API call. Add the permission to app.json under android.permissions or specify an entry in android.capabilities. |
UnsupportedFeature exception |
The physical device lacks the required hardware sensor (e.g. gyroscope, light sensor, camera torch). Check await sensors.available() before watching. |
ResourceBusy exception |
Another system dialog (file picker, camera, biometric prompt) is already open, or the resource limit is reached (max 64 event coroutines, 32 pending requests, 16 sensor subscriptions, 8 media/recording handles). Concurrently launching two system pickers is prohibited. |
DeviceUnavailable exception |
The device operation was called in an environment without the native Android device bridge (such as on desktop host or in the experimental WebView backend). |
DeviceIOError exception |
Low-level storage or ContentProvider stream error occurred while reading/writing a file. Catch and offer re-selection. |
| Manifest verification fails on build | ZKite’s Rust parser rejected the compiled AndroidManifest.xml. Check .zkite/permissions.json and ensure manual permissions are valid Android permission identifiers. |
| Deep link does not open app | Rebuild and reinstall your application (zkite run). Python hot reload cannot alter the binary AndroidManifest.xml. For custom schemes, check scheme/host casing. For HTTPS App Links, verify assetlinks.json hosted at your domain and check SHA-256 certificate matching. |
| Python widgets not visible over video | The native Android video surface renders above the Python declarative tree. Use control_style for controls on the video, or place Python controls outside the video rectangle or inside an Overlay. |
| Video bounds out of position | Video bounds are absolute content coordinates in Android dp and do not automatically reflow. Call await player.bounds(x, y, width, height) after changing layout. |
| Audio/video pauses unexpectedly | Check snapshot.reason. Incoming calls, transient focus loss, or disconnected Bluetooth/wired headphones pause playback. Resume explicitly with await player.resume(). |
Submitting a Useful Bug Report
Section titled “Submitting a Useful Bug Report”When reporting an issue:
- Include exact ZKite distribution versions (
python -m pip show zkite zkite-framework zkite-payload). - Host OS, Python version, target device model, and Android OS version.
- State whether the issue occurs in preview (
zkite dev), standalone (zkite run), or both. - Provide the minimal reproducible code sample along with sanitized terminal logs.
