react-native-fontawesome icon indicating copy to clipboard operation
react-native-fontawesome copied to clipboard

Unrecognized font family "FontAwesome"

Open Luckygirlllll opened this issue 6 years ago • 10 comments

I got an error "Unrecognized font family "FontAwesome", after the adding library to the project. How is possible to fix that?

Luckygirlllll avatar Mar 01 '18 13:03 Luckygirlllll

Did you check the version of FontAwesome??

Version 4.7.0 works fine with me

Here's your download URL

https://fontawesome.com/v4.7.0/

orcjun avatar Mar 19 '18 09:03 orcjun

I get this same error and I followed the instructions to add the font file via the links given. @rturk @arnebr

  • My ttf file is in my Xcode project, it's listed correctly in the info.plist, but stil getting the error.

ghost avatar Mar 29 '18 19:03 ghost

Having the same issue. I think you need to download / install the ttf manually. It does not say what the naming convention is.

paul-hart avatar Apr 03 '18 19:04 paul-hart

I think you need to download / install the ttf manually

@paul-hart did you figure it out? I downloaded manually but still same issue.

ghost avatar Apr 05 '18 20:04 ghost

Running into the same issue. I found out you have to do the following (it's missing from the instructions):

  1. Download the Font from the link mentioned in this issue
  2. Put the font into your project folder. I used /myproject/assets/fontawesome for that, not the /myproject/ios folder.
  3. Add the font to your ios build like here: https://medium.com/@dabit3/adding-custom-fonts-to-react-native-b266b41bff7f
  4. do react-native run-ios and restart your simulator

Note: you can add the font from your project folder, no need to manually copy it.

grobmeier avatar Apr 26 '18 09:04 grobmeier

With the very latest version of the free FontAwesome that I just downloaded, its font name (not filename) is "FontAwesome5FreeRegular" and not "FontAwesome". So renaming the fontFamily in Icon.js to "FontAwesome5FreeRegular" fixes this for me.

thorlando avatar Aug 12 '18 21:08 thorlando

same problem

imansalhi avatar Aug 26 '18 12:08 imansalhi

Same issue. Unrecognized font family "FontAwesome" error in simulator.

KovalevAnton avatar Oct 08 '18 05:10 KovalevAnton

Actually the font family in iOS is now "Font Awesome 5 Free" (FA really broke everything this time).

Import Platform into Icons.js and add this:

FAB: Platform.OS == 'ios' ? "Font Awesome 5 Free" : 'fa_solid_900'

Weird that nobody reported this.

sfratini avatar Nov 29 '18 19:11 sfratini

In my case I just grabbed the sample project fonts and used those instead of the broken new ones, it worked and I didn't had to modify any file.

javicorvus avatar Aug 29 '20 21:08 javicorvus