Yumel Hernandez
Yumel Hernandez

Reputation: 5

Google Vision Image Labeling API Error

I keep receiving an error of "API key expired. Please renew the API key" on IOS when I run my app on my phone. It only happens when I try to use the cloud's image labeling. I have renewed the key multiple times and have waited quite some time but the error persists.

vision.cloudLabelDetector()

However when I run the on device model it works perfectly fine.

vision.labelDetector()

Keep in mind when I run the on device model I also hook into google's translate API and that works so it doesn't appear the API Key is expired.

I also built the exact same app not too long ago and repasted the code and hooked everything the way its supposed to be. I have also enabled the API on google's developer console (new project).

Upvotes: 0

Views: 148

Answers (1)

Isabella Chen
Isabella Chen

Reputation: 2431

You mentioned you "renewed the key multiple times". When you "regenerate" the key, the old key would expire (after certain amount of grace period). The old key is still in your GoogleService-Info.plist and Firebase ML Kit Cloud Image Labeling uses the old key from GoogleService-Info.plist. That's why you saw the error message.

For other developers: In general, check your API_KEY in GoogleService-Info.plist exist in Google Cloud Platform developer console.

See screenshot: enter image description here

And if it doesn't exist, please re-download / replace your GoogleService-Info.plist from Firebase Developer Console.

Upvotes: 2

Related Questions