entria/react-native-fontawesome

Unrecognized font family "FontAwesome"

Luckygirlllll opened this issue ยท 10 comments

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

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/

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.

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

I think you need to download / install the ttf manually

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

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.

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.

same problem

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

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.

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.