Skip to content

Exception: Failed to load font with url https://fonts.gstatic.com (google_fonts) #534

Closed as not planned

Description

@aykutuludag

Package

google_fonts 6.1.0 (https://pub.dev/packages/google_fonts/versions/6.1.0)

Existing issue?

What happened?

I'm getting some error on Android via Firabase Crashlytics. Here is log output. I encountered this error once in my device. If this error occurs, Flutter loads default font in Android app and continue without crashing. But anyway I'm getting errors and maybe this will help to fix bugs. Error has different variants.

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Exception: Failed to load font with url https://fonts.gstatic.com/s/a/e549403e4a007249673d041c55e7205d754210d79b962001d95a8313191aa3c2.ttf: HandshakeException: Handshake error in client (OS Error: 
	CERTIFICATE_VERIFY_FAILED: Hostname mismatch(handshake.cc:393))
       at ._httpFetchFontAndSaveToDevice(google_fonts_base.dart:263)
       at .loadFontIfNecessary(google_fonts_base.dart:180)
       at googleFontsTextStyle.<fn>(google_fonts_base.dart:117)
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Exception: Failed to load font with url https://fonts.gstatic.com/s/a/e549403e4a007249673d041c55e7205d754210d79b962001d95a8313191aa3c2.ttf: ClientException with SocketException: Failed host lookup: 'fonts.gstatic.com' (OS Error: No address associated with hostname, errno = 7), uri=https://fonts.gstatic.com/s/a/e549403e4a007249673d041c55e7205d754210d79b962001d95a8313191aa3c2.ttf
       at ._httpFetchFontAndSaveToDevice(google_fonts_base.dart:263)
       at .loadFontIfNecessary(google_fonts_base.dart:180)
       at googleFontsTextStyle.<fn>(google_fonts_base.dart:117)
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Exception: Failed to load font with url https://fonts.gstatic.com/s/a/e549403e4a007249673d041c55e7205d754210d79b962001d95a8313191aa3c2.ttf: ClientException with SocketException: Connection reset by peer (OS Error: Connection reset by peer, errno = 104), address = fonts.gstatic.com, port = 44498, uri=https://fonts.gstatic.com/s/a/e549403e4a007249673d041c55e7205d754210d79b962001d95a8313191aa3c2.ttf
       at ._httpFetchFontAndSaveToDevice(google_fonts_base.dart:263)
       at .loadFontIfNecessary(google_fonts_base.dart:180)
       at googleFontsTextStyle.<fn>(google_fonts_base.dart:117)

image_2024-01-06_171837299

Have a nice day

Relevant log output

[√] Flutter (Channel stable, 3.16.0, on Microsoft Windows [Version 10.0.22621.2861], locale en-US)
    • Flutter version 3.16.0 on channel stable at C:\FlutterSDK
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db7ef5bf9f (7 weeks ago), 2023-11-15 11:25:44 -0800
    • Engine revision 74d16627b9
    • Dart version 3.2.0
    • DevTools version 2.28.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\AndroidSDK
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = C:\AndroidSDK
    • ANDROID_SDK_ROOT = C:\AndroidSDK
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.25)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.33423.256
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.79.2)
    • VS Code at C:\Users\Aykut\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22621.2861]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 117.0.5938.134
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 120.0.2210.91

[√] Network resources
    • All expected network resources are available.

• No issues found!

Activity

  1. added
    triageIssues that haven't been fully triaged (labels applied, reproducible bug / relevant feature request)
    on Jan 6, 2024
  2. aykutuludag commented on Feb 15, 2024

    @aykutuludag
    Author

    image

    I'm still getting a lot of error. Is there any update to fix this issue? I found similar issues https://stackoverflow.com/questions/61124989/error-google-fonts-was-unable-to-load-font but without conclusive answer.

    UPDATE
    As far as I can see problem is about internet connection BETWEEN DEVICE TO GSTATIC.COM. I was thinking google_fonts library imported fonts into app when I build apk/ipa. However, I think the fonts are downloaded when the application is first started on the device.

    SUGGESTION
    So my simple suggestions is: Is it possible to change library to insert fonts on buildtime, not first runtime on device. Kind regards.

  3. aykutuludag commented on Feb 15, 2024

    @aykutuludag
    Author

    Same issue: #537

  4. aykutuludag commented on Feb 15, 2024

    @aykutuludag
    Author

    #521 is same issue.

  5. aykutuludag commented on Feb 15, 2024

    @aykutuludag
    Author

    #507 is same issue.

  6. changed the title [-]Exception: Failed to load font with url https://fonts.gstatic.com[/-] [+]Exception: Failed to load font with url https://fonts.gstatic.com (google_fonts)[/+] on Feb 15, 2024
  7. aykutuludag commented on Feb 15, 2024

    @aykutuludag
    Author
  8. LuuNgocLan commented on Feb 16, 2024

    @LuuNgocLan

    I got the same issue on Android device reported by Firebase crashlytics

    • Sdk_gphone64_arm64: 75%
    • Galaxy S20 5G: 25%

    image

    When I turn off wifi and open the app, it can't load Google font from network

  9. vargab95 commented on Feb 26, 2024

    @vargab95

    I think, the solution is already documented here.

    The google_fonts package will automatically use matching font files in your pubspec.yaml's assets (rather than fetching them at runtime via HTTP). Once you've settled on the fonts you want to use:

  10. guidezpl commented on Feb 26, 2024

    @guidezpl
    Collaborator

    This is not a solution, just another option for fetching fonts. I'm going to create a pinned issue for this

  11. guidezpl commented on Feb 26, 2024

    @guidezpl
    Collaborator

    Closing in favor of material-foundation/google_fonts_flutter#25

  12. removed
    triageIssues that haven't been fully triaged (labels applied, reproducible bug / relevant feature request)
    on Feb 26, 2024
  13. med-rami-dev commented on Mar 8, 2024

    @med-rami-dev

    same issue

  14. Ashrockzzz2003 commented on Jun 18, 2025

    @Ashrockzzz2003

    In Android Simulator

    In my case, I had set the date to the future. Like if correct(current day) date is 18 June 2025 -> for testing something, I changed emulator system date to year 2027, that just broke a lot of things. But then resetting the system date and time to automatic and present day resolved the issue for me.

    SSL cert verification and date - I believe has something to do.

  15. mafreud commented on Jul 21, 2026

    @mafreud

    For further reference.
    flutter/packages#12240

  16. added theissue type on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions