androidengineers.Book a session

Diagnose device failures

Diagnose device failures

articleSelf-paced

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

SymptomInvestigateAppropriate next action
HTTP failure or short downloadnetwork, saved partial, response statusretry/resume after checking connection
SHA-256 mismatchexact artifact and transferobtain a fresh pinned copy
Missing vision encoderartifact capabilitiesuse the specified multimodal artifact
Missing native librarymanifest, ABI, packaging, vendor accessinspect versioned SDK setup guidance
GPU buffer exceeds maximumbackend allocation constrainttest compatible hardware or a separately verified backend
No text before timeoutmodel work, settings, device pressureretain 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.

Roadmap · Hands-on codelab · Pinned source

YOUR LEARNING JOURNEY

0 of 13 available lessons completed

Progress saved in this browser. No account needed.
Diagnose device failures | Gemma on Android with PocketStories — Preview | Android Engineers