Closed
Description
Step 2: Describe your environment
- Android Studio version: Dolphin, 2021.3.1
- Firebase Component: firebase-ml-modeldownloader
- Component version: 24.0.5
Step 3: Describe the problem
In 2 situations, model download is failing.
- for some reason, it has started to fail on my WiFi connection, while on mobile data it works. this has started recently.
- when model name passed is empty string.
while there can be a problem with the network, and of course in point no 2 it should fail, but error message it is giving is misleading.
Error message for Empty model name:
Permission error while fetching model (): HTTP response from Firebase Download Service: [401 - Unauthorized: API keys are not supported by this API. Expected OAuth2 access token or other authentication credentials that assert a principal. See https://cloud.google.com/docs/authentication]
And yes, I have restricted my API key with debug/release keys.
Steps to reproduce:
restrict API key with android app's debug/release key, send modelName as empty string to getModel()
method.
Relevant Code:
FirebaseModelDownloader.getInstance(FirebaseApp.getInstance())
.getModel("", DownloadType.LOCAL_MODEL, conditions)