-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unrecognized font family Material Icons? #965
Comments
Hi, your build is failing and launching a previously compiled (out of date) binary. It seems that you've drag-and-dropped files to your project that has since been deleted from this project instead of importing the project itself. Try to link this library again using the instructions in the readme. |
@bhoomesh950 Make sure the font is linked and also make sure you're importing
Rather than
Which my editor's (vim) autocomplete (coc) suggested. (It actually suggested both, but I got the same error as you before getting linking setup (rerun I hope I helped. If not, good luck! |
After installation you need to link the library (After the updation of React Native 0.60, they have introduced autolinking feature means we do not require to link the library but they have also mentioned that some libraries need linking and react-native-vector-icons is one of those cases). You can follow Example to Use Vector Icons in React Native for the updated example of React Native 0.60 |
I had the same issue with These steps solved the issue on my machine.
Note: I have no global installation of |
for me was the face that the fonts were not defined in the info.plist |
Encountered this issue today and spent an hour debugging it. My issue was resolved by checking the info.plist file and adding the fonts to the UIAppFonts array as they were missing in it:
|
AntDesign.ttf Entypo.ttf EvilIcons.ttf Feather.ttf FontAwesome.ttf FontAwesome5_Brands.ttf FontAwesome5_Regular.ttf FontAwesome5_Solid.ttf Foundation.ttf Ionicons.ttf MaterialIcons.ttf MaterialCommunityIcons.ttf SimpleLineIcons.ttf Octicons.ttf Zocial.ttf Thanks, this helped me. |
@Seishin When I apply your fix, I can't start my app (try it with a fresh start aka. close simulator and terminal). I get the error described here: And if I unlink the assets, the icons aren't found again. |
@Seishin I really appreciate your help.... worked smooth !!!!! |
@Seishin really helped me. Thanks!!!! |
Thanks @fibric, your step-by-step worked perfectly! |
Thank you @Seishin 😃 |
- Change to legacy build on Xcode - Copy AppDelegate.h and AppDelegate.m from native react-native project to remove unimodule - Add font to info.plist oblador/react-native-vector-icons#965 (comment)
This should be in the docs (adding fonts to |
In RN 0.60 no need for manual setup or even using the link command (using it would cause duplication errors and would make the errors even worse). The solution by @Seishin works perfectly in case of RN 0.60 and above. For some reason my array was empty in plist replacing it with @Seishin 's array worked. |
@janhesters I had the same issue as you and I wanted to confirm that once I unlinked and applied the solution suggested by @Seishin it all worked fine. |
If anyone has an issue even follow @Seishin 's solution, then, you can see those lines in the console.
|
Worked fine for. I was getting error even following all others solutions. But why need link in react-native > 0.60? |
My problem was that I didn't had folder 'Fonts' in xcodeproj, read here for more info. |
And then restart by run |
After you add the file to info.plist and run |
Unbelievable troublesome to use this lib. Tried the all suggestions above, none work for me. End up I have to drag and drop the .tff file manually from node_module to xcode. Check the steps here |
this worked why this library hasnt fixed the auto linking we waste so much time doing this |
@TommyLeong @ShivamJoker I agree its a pain to keep having this issue, I find myself here quite a bit too. BUT we can't forget that open source maintainers are doing this for free and it's our choice to use or not. |
|
Perfect!!! |
This works perfectly! Thanks!!!!!! |
(See: oblador/react-native-vector-icons#965) and installed @react-navigation depdendencies
- This commit might porentially cause build errors in future - Issue: oblador/react-native-vector-icons#965 - Had to do manual linking despite autolinking in newer versions of RN (autolinking does not work with react-native-vector-icons) - Checkmarked `Run script only when installing` just like @adjoaEdwin described in issue linked above
Thanks for saving my time 👏👏👏👏👏👏👏👏👏 |
I just need to do the following:
And in the component I use MaterialIcons:
|
@gsmartins96 thank you for pointing this out. After importing, I added Icon.loadFont(); in componentDidMount. Is adding it to componentDidMount proper use? |
I ran into the problem, and it's ridiculous that I still have to use the same workarounds from two years ago. All this time and the core problem still hasn't been resolved. Thank you @adjoaEdwin and @Seishin, either of your solutions work for me. |
I'm using VS Code instead of XCode, and I wasn't able to follow along with some of the answers above. I found this StackOverflow answer that did help me, however. Basically, put the following in your command line: I'm guessing my app just needed to be restarted for the changes to take effect. Hope this helps someone. |
Thanks @Seishin .
|
follow the below link for solution |
I am new to React-Native, I have added react-native-vector-icons library manually to Xcode and Android studio. if run the code with Xcode its executing successfully without any issue. but if i trying to run the code from Terminal (react-native run-ios) its showing 'Unrecognized font family Material' in simulator. but the same this working if i runs the command (react-native run-android).
Please help me
The text was updated successfully, but these errors were encountered: