I have used the Google fonts package in my flutter application
https://pub.dev/packages/google_fonts
The app runs fine on debug mode and the fonts load without any issue.
But, however, when I build and run the application in release mode, the fonts fail to load. Most of the time the app crashes and sometimes the default Roboto font is loaded.
There are some issues open on GitHub but any of that doesn't fix my issue.
I tried cleaning the build folder, rechecked pubspec.yaml file, checked the google_fonts package version, verified internet connectivity, and even recreated the project. But nothing solved the issue.
version:
google_fonts: ^1.1.0
I got this error log while running the app using flutter run --release command
Here's the error I got:
I/flutter (17872): Error: google_fonts was unable to load font Montserrat-SemiBold because the following exception occured:
I/flutter (17872): Exception: Failed to load font with url: https://fonts.gstatic.com/s/a/5f82f6e55db43e905c6ab9d04395566b243c41798d6a53545ffbd10ed6c424c4.ttf
I/flutter (17872): Error: google_fonts was unable to load font Montserrat-Medium because the following exception occured:
I/flutter (17872): Exception: Failed to load font with url: https://fonts.gstatic.com/s/a/cec0f6e0bfbfaa352eb189f0eb220916dd278b02aaf824be87055ba5cc38d58b.ttf
I/flutter (17872): Error: google_fonts was unable to load font Montserrat-Regular because the following exception occured:
I/flutter (17872): Exception: Failed to load font with url: https://fonts.gstatic.com/s/a/470e93c06a9fffa6851375f54047917a9d774ed6027d9f044cd1bc8d4cd5630b.ttf