react-native unrecognized font family FontAwesome5Pro-Solid

久未见 提交于 2019-12-13 19:17:05

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/55206178/react-native-unrecognized-font-family-fontawesome5pro-solid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!