I am trying to build an image recognition app but Firebase Studio is not able to fix a recurrent error

Hi,
Firebase is not able to fix the error below. Any hists?
Thanks/Brgds
j

1/1

Next.js 15.5.9 (outdated)Turbopack

Console GenkitErrorServer

UNKNOWN: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent: [404 Not Found] models/gemini-1.5-flash is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.

src/ai/flows/recognize-stored-object-flow.ts (118:19) @

  116 |

117 | for (const storedObject of input.storedObjects) {

> 118 | const res = await compareObjectPrompt({

  |                   ^

119 | cameraImageDataUri: input.cameraImageDataUri,

120 | frontImageDataUri: storedObject.frontImageDataUri,

121 | backImageDataUri: storedObject.backImageDataUri,

Call Stack6

Show 5 ignore-listed frame(s)

src/ai/flows/recognize-stored-object-flow.ts (118:19)

Hey @jcasqueiro

Your issue is straightforward — the model gemini-1.5-flash has been fully retired by Google. All requests to Gemini 1.5 models now return a 404, which is exactly what you’re seeing.

The fix is just updating the model name in your flow. In your file:

src/ai/flows/reconocer-objeto-almacenado-flow.ts (around line 118)

Replace gemini-1.5-flash with one of these:

• gemini-2.0-flash — closest replacement, solid balance of speed and cost
• gemini-2.5-flash-lite — newer, cheaper, great for high-volume tasks
• gemini-3-flash-preview — latest generation if you want cutting-edge performance

Also heads up: gemini-2.0-flash is scheduled for retirement on June 1, 2026, so if you’re starting fresh, I’d go straight to 2.5-flash-lite or 3-flash-preview to avoid migrating again soon.

One more thing — your Next.js version (15.5.9) is also flagged as obsolete, so you might want to update that too while you’re at it.

Hope that helps! :call_me_hand:

2 Likes