Find the first meaningful failure
A long exception can end at a wrapper call while the real cause appears earlier in native logs. Read the failure phase and the first concrete resource or capability error. Avoid treating every failure as corrupt weights. The emulator's corrected model reached vision compilation and then requested a buffer larger than the graphics backend allowed.
Requested buffer: 152409600 bytes (~145.35 MiB)
Maximum buffer: 134217728 bytes (128 MiB)
Result: RESOURCE_EXHAUSTED during vision compilation
This is a per-buffer limit, not total app RAM, disk capacity or Java heap. The model was already downloaded and the vision encoder was present. Increasing storage or retrying the same download cannot change that backend limit. CPU vision is an investigation option, not an implemented fallback or a guaranteed solution in this source.
Collect focused evidence
adb devices -l
adb -s YOUR_DEVICE_SERIAL shell getprop ro.product.cpu.abi
adb -s YOUR_DEVICE_SERIAL shell df -h /data
adb -s YOUR_DEVICE_SERIAL logcat -d -s native litert tflite
Replace the serial with a value from the first command. Capture only relevant errors for a public issue; logs may contain private paths or content. Record model revision, SDK version, backend and the stage reached. Do not publish an entire device log or personal photo to make a reproduction convenient.
Recovery decision table
| Symptom | Investigate | Appropriate next action |
|---|---|---|
| HTTP failure or short download | network, saved partial, response status | retry/resume after checking connection |
| SHA-256 mismatch | exact artifact and transfer | obtain a fresh pinned copy |
| Missing vision encoder | artifact capabilities | use the specified multimodal artifact |
| Missing native library | manifest, ABI, packaging, vendor access | inspect versioned SDK setup guidance |
| GPU buffer exceeds maximum | backend allocation constraint | test compatible hardware or a separately verified backend |
| No text before timeout | model work, settings, device pressure | retain partial evidence and inspect runtime timing |
Practice
Classify these cases before touching code: 503 from the host, hash mismatch, correct model with 128 MiB buffer limit, and Room save failure. Explain why retrying inference is not a fix for the first or last case. Design a concise user message plus an expandable developer detail area. The current preview still exposes a truncated native error; improving that UX is a capstone opportunity, not a finished feature.