skip to Main Content

I have made an app which uses a custom .ttf font. Unfortunately this font only works in the Android emulator. On my Samsung A52s phone (Android 14, One UI 6.1) it shows the default font.

  • Removing the app and install it again had no effect
  • Clearing the app cache had no effect
  • Using another font had no effect
  • Renaming the app bundle id e.g. com.company.app to com.company.app2 has no effect
  • Installing another app with the same font, shows the font without any issue
  • On iOS both the simulator and iPhone show the font without any issue
  • flutter clean had no effect
  • Rebuilding the app had no effect
  • Upgrading Android on the phone had no effect
  • Reboot had no effect

When you Google for "Flutter custom font not working" you get issues where the custom font did not work at all. In my case it is just the Android Phone.

Has anyone experienced the same?

2

Answers


  1. Chosen as BEST ANSWER

    This is super weird. When I removed the:

     textTheme: TextTheme(
    

    From my theme it worked. Then when I restored the exact same code it worked as well.


  2. To add a font to text you need to add font files in assets, mention those font and font family in pubspec.yaml file (check indentation) and then applying font using textStyle.

    if you are using GoogleFonts package then you must give Internet permission in manifest file to make it work.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search