简体   繁体   中英

react-native unrecognized font family FontAwesome5Pro-Solid

I use react-native-vector-icons for icons

import Icon from 'react-native-vector-icons/FontAwesome5Pro'

All FontAwesome web fonts I put to assets/fonts and add this folder to rnpm section in package.json

"rnpm": {
    "assets": [
      "./assets/Fontawesome/webfonts/"
    ]
}

Then I run react-native link

All this fonts I see in info.plist but when

<Icon name="user" solid />

I see error unrecognized font family FontAwesome5Pro-Solid. It's funny, but on my old macbook all works fine, I just clone my repository and run project and this error appeared...

在此处输入图片说明

What can I to try to solve this?

I found the problem. It seems that FontAwesome5Pro-Solid fonts are either missing are broken in version 6.4.X of react-native-vector-icons .

So, to fix this problem I had to revert back to a previous version in my package.json file:

"react-native-vector-icons": "6.3.0",

It is important to also remove the ^ in front of the version so that it does not update to the latest version. The maintainer is aware of the problem , and it should be fixed soon.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM