Skip to content

ML Model Downloader is giving wrong exception #4157

Closed
@sandeep5193

Description

@sandeep5193

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.

  1. for some reason, it has started to fail on my WiFi connection, while on mobile data it works. this has started recently.
  2. 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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions