My Gemini API key is not working?

I have a Google Gemini API key. But it isn’t working for my app I’m building in Android Studio.

The response I keep getting is :
Error 404: The API Key may be invalid or the project doesn’t have Gemini enabled.

Hello @Steven_Rice,

Thank you for your question.

The 404 error typically indicates that the API key is not being detected within your Android app environment. We have a detailed guide on setting up Gemini API keys which you can find here.

Please double-check that your API key variable is accessible and verify that the value matches exactly with the key listed on your dashboard.