Skip to content

fix(ai-sample-catalog): explain Firebase AI setup, billing, and blocked requests - #188

Open
saadkhalidkhan wants to merge 1 commit into
android:mainfrom
saadkhalidkhan:fix/catalog-firebase-ai-error-guidance
Open

saadkhalidkhan wants to merge 1 commit into
android:mainfrom
saadkhalidkhan:fix/catalog-firebase-ai-error-guidance

Conversation

@saadkhalidkhan

@saadkhalidkhan saadkhalidkhan commented Sep 16, 2026

Copy link
Copy Markdown

Summary

Improve Firebase AI Logic setup guidance and replace raw generate-content failures with actionable messages. Image generation samples now call out that billing is typically required.

Fixes #140

Motivation

Users running cloud samples, especially Nano Banana / Nano Banana Pro, often see opaque errors such as GenerateContent are blocked. That usually means the Android API key does not allow the Firebase AI Logic API, or the model needs a Blaze plan. The catalog previously linked the Firebase dialog to outdated Vertex AI docs and did not explain those requirements.

Changes

  • Add a shared Firebase AI error mapper in ui-component and use it from cloud sample ViewModels.
  • Map API-key 403s, quota/billing failures, and prompt-blocked responses to user-facing guidance.
  • Mark image generation catalog entries with needsBilling and show a note on the sample cards.
  • Point the Firebase required dialog at the current Firebase AI Logic Android setup guide.
  • Document API key restrictions and billing in the catalog and image-generation sample READMEs.

Testing

  • ./gradlew :ui-component:testDebugUnitTest
  • ./gradlew spotlessApply
  • ./gradlew :ui-component:lintDebug :app:lintDebug
  • Compiled :app and the updated sample modules (compileDebugKotlin)
  • Instrumentation tests were not run in this change (no UI interaction beyond catalog copy)

Screenshots / Video

N/A for functional behavior. Catalog cards for Nano Banana Pro, Nanobanana, and Magic Selfie now include a short billing note.

Additional Notes

  • Samples still use GenerativeBackend.googleAI(). This does not switch backends.
  • Billing is called out for image generation models only. Other Firebase samples keep the existing Firebase-required check.
  • Mapper matching is based on exception type/message text so it does not depend on a new Firebase SDK API.

…ed requests


Replace raw GenerateContent blocked errors with guidance for API key restrictions and Blaze billing, and document those requirements in the catalog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate Content are Blocked

1 participant