Firebase AI (Gemini Flash) throwing DECODE_PREEMPTED and UNAVAILABLE errors during Android app image analysis


I am developing an Android application using Firebase AI and the Gemini Flash model for image analysis. Recently, the app has started failing intermittently with the following errors in the Firebase console:

  • UNAVAILABLE

  • DECODE_PREEMPTED ("Preempted out of decode queue by a higher priority request")

  • INTERNAL ("This model is currently experiencing high demand.")

Additional Context:

  • This workflow and application were working completely fine previously without any code changes on my end.

  • The issue happens across multiple circuit/substation images, so it's not specific to a single corrupt image file.

  • I am currently on the Free Tier (Spark Plan).

My Questions:

  1. Is this a known Google-side backend capacity issue or regional load problem with Gemini Flash?

  2. Do requests failing with DECODE_PREEMPTED count against the Free Tier daily request quota?

  3. Are there any best practices or recommended retry strategies in Android/Firebase to handle this gracefully?

-1
Sep 26 at 6:11 PM
User AvatarRajesh Mangalapuram
#android#firebase#google-gemini#firebase-ai-logic

No answer found for this question yet.