Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: google_fonts was unable to load font

Tags:

flutter

I'm trying to use GoogleFonts to test my UI but I'm getting this strange error error: google_fonts was unable to load font.

Thats occurs with any single font.

This is my setup VsCode Flutter 1.12.13+hf9 Windows 10

pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  google_fonts: ^0.4.0

Code

import 'package:google_fonts/google_fonts.dart';
Text('data2', style: GoogleFonts.mcLaren())

Error

I/flutter ( 5069): error: google_fonts was unable to load font McLaren-Regular because the following exception occured I/flutter ( 5069): Exception: Failed to load font with url: https://fonts.gstatic.com/s/a/ca48a5e17b0201057453d49c4271d139e5824b553505ad1c6fbbd7cbbbf4d1dc.ttf

[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows, locale pt-BR)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] Android Studio (not installed)
[√] VS Code, 64-bit edition (version 1.44.0)
[√] Connected device (1 available)

! Doctor found issues in 1 category.
like image 990
rubStackOverflow Avatar asked Apr 09 '20 15:04

rubStackOverflow


1 Answers

My mistake, I figure out that:

Emulator/device needs internet connectivity.
Google fonts need internet connection on device/emulator.

like image 178
rubStackOverflow Avatar answered Nov 02 '22 14:11

rubStackOverflow