Repository navigation
Closed as not planned
Closed as not planned
Copy link
Description
Package
google_fonts 6.1.0 (https://pub.dev/packages/google_fonts/versions/6.1.0)
Existing issue?
- I checked the existing issues
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)
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!Reacted by Luu Ngoc Lan
Metadata
Metadata
Assignees
Labels
No labels

Activity
aykutuludag commentedon Feb 15, 2024
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.
aykutuludag commentedon Feb 15, 2024
Same issue: #537
aykutuludag commentedon Feb 15, 2024
#521 is same issue.
aykutuludag commentedon Feb 15, 2024
#507 is same issue.
[-]Exception: Failed to load font with url https://fonts.gstatic.com[/-][+]Exception: Failed to load font with url https://fonts.gstatic.com (google_fonts)[/+]aykutuludag commentedon Feb 15, 2024
@rodydavis
LuuNgocLan commentedon Feb 16, 2024
I got the same issue on Android device reported by Firebase crashlytics
When I turn off wifi and open the app, it can't load Google font from network
vargab95 commentedon Feb 26, 2024
I think, the solution is already documented here.
guidezpl commentedon Feb 26, 2024
This is not a solution, just another option for fetching fonts. I'm going to create a pinned issue for this
guidezpl commentedon Feb 26, 2024
Closing in favor of material-foundation/google_fonts_flutter#25
med-rami-dev commentedon Mar 8, 2024
same issue
Ashrockzzz2003 commentedon Jun 18, 2025
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.
mafreud commentedon Jul 21, 2026
For further reference.
flutter/packages#12240