flutter: Failed to load font Roboto at https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf

889 Views Asked by At

I have updated my Android Studio to Android Studio Electric Eel | 2022.1.1 Patch 1.

While trying to run my Flutter starter app on Chrome web I got a blank web page with this error.

3

There are 3 best solutions below

1
On

I got the same issue while running my flutter project. I used 'flutter run -d chrome' to run it and the issue disappeared.

0
On

I solved this problem by downloading and installing the roboto font separately.

First download the ttf file through the browser, and then install it to your system, the error log will disappear when you run the program again.

0
On

I have fixed this issue by including Roboto font family locally in my project.

  fonts:
    - family: SomeFont
      fonts:
        - asset: assets/fonts/SomeFont/SF-Regular.ttf
    - family: Roboto # Here
      fonts:
        - asset: assets/fonts/Roboto/Roboto-Regular.ttf

Before include

enter image description here

After include Roboto Font family

enter image description here

Also you can use Roboto as fallback font family:

ThemeData(
      fontFamilyFallback: const ["Roboto"],
);