flutter-packages icon indicating copy to clipboard operation
flutter-packages copied to clipboard

cannot load rubik font and other with Google Fonts in flutter

Open tarunchauhan97 opened this issue 3 years ago • 1 comments

I/flutter ( 3328): Error: google_fonts was unable to load font Roboto-Bold because the following exception occurred: I/flutter ( 3328): Exception: Failed to load font with url: https://fonts.gstatic.com/s/a/05b2d0935046846efe2c8786ad1c5d909a11c3431787eea52f2fc70f2a8a6edf.ttf I/flutter ( 3328): I/flutter ( 3328): See https://docs.flutter.dev/development/data-and-backend/networking#platform-notes. I/flutter ( 3328): If troubleshooting doesn't solve the problem, please file an issue at https://github.com/material-foundation/google-fonts-flutter/issues/new . I/flutter ( 3328): Error: google_fonts was unable to load font Manrope-ExtraBold because the following exception occurred: I/flutter ( 3328): Exception: Failed to load font with url: https://fonts.gstatic.com/s/a/838f6171cd41ca2a1af76ffc775cd03382a967d7b909b92430b27bce07e03c37.ttf I/flutter ( 3328): I/flutter ( 3328): See https://docs.flutter.dev/development/data-and-backend/networking#platform-notes. I/flutter ( 3328): If troubleshooting doesn't solve the problem, please file an issue at https://github.com/material-foundation/google-fonts-flutter/issues/new . I/flutter ( 3328): Error: google_fonts was unable to load font Manrope-Light because the following exception occurred: I/flutter ( 3328): Exception: Failed to load font with url: https://fonts.gstatic.com/s/a/bb155a1342521cb4f825d36301d550173f81516f55574c55f404092177fdff71.ttf I/flutter ( 3328): I/flutter ( 3328): See https://docs.flutter.dev/development/data-and-backend/networking#platform-notes. I/flutter ( 3328): If troubleshooting doesn't solve the problem, please file an issue at https://github.com/material-foundation/google-fonts-flutter/issues/new .

tarunchauhan97 avatar Jun 14 '22 16:06 tarunchauhan97

Hi, the URLs are valid, so what troubleshooting steps have you tried?

guidezpl avatar Jun 14 '22 18:06 guidezpl

Hello, I'm facing the same issue running my app on macos. What trouble shoot do you want me to do?

ValentinVignal avatar Oct 06 '22 15:10 ValentinVignal

Hey, i don't remember but this issue was resolved. Try cache clean and flutter pub get

tarunchauhan97 avatar Oct 06 '22 15:10 tarunchauhan97

Hello @tarunchauhan97 , I just created an app from scratch and got the issue. I also did a flutter clean && flutter pub get and I still get

flutter: Error: google_fonts was unable to load font Inconsolata-Regular because the following exception occurred:
Exception: Failed to load font with url: https://fonts.gstatic.com/s/a/997ffa086ccc4682e2d05447638f2bb25a5e960ec9cda5f1acaa22cee621974e.ttf
flutter:
See https://docs.flutter.dev/development/data-and-backend/networking#platform-notes.
flutter: If troubleshooting doesn't solve the problem, please file an issue at https://github.com/material-foundation/google-fonts-flutter/issues/new .

ValentinVignal avatar Oct 06 '22 16:10 ValentinVignal

In my case, I was on macOS and I didn't add

  <key>com.apple.security.network.client</key>
  <true/>

to DebugProfile.entitlements or Release.entitlements as explained in the doc: https://pub.dev/packages/google_fonts#http-fetching

Adding it solved the issue

ValentinVignal avatar Oct 11 '22 06:10 ValentinVignal