Skip to content
the poor coder

react-native-vector-icons unrecognized font family

Poor Man
Published
Reading time
1 min read
On this page

React Native Vector Icons Unrecognized Font Family#

If you are working with React Native and have installed the React Native Vector Icons package, you may encounter an issue where the icon font is not recognized and instead displays as a series of boxes or question marks.

The Problem#

This problem occurs because the font files for the icons are not being properly linked to the project. This can happen when the package is installed but not properly configured or when the font files are not included in the project.

The Solution#

There are a few steps you can take to fix this issue:

  • Link the font files: The first step is to link the font files to your project. To do this, open your terminal and navigate to your project directory. Then, run the following command:
JavaScript
react-native link react-native-vector-icons

This will automatically link the font files to your project and ensure that they are properly installed.

  • Clear cache: If linking the font files does not fix the issue, try clearing the cache of your project. This can be done by running the following command:
JavaScript
react-native start --reset-cache

This will clear the cache of your project and force it to recompile, which may resolve any issues with the font files.

  • Manually link the font files: If the above steps do not work, you can try manually linking the font files to your project. To do this, follow these steps:
  1. Open the finder on your Mac and navigate to the node_modules/react-native-vector-icons/Fonts folder.
  2. Copy all the files in the Fonts folder and paste them into the ios/{your-project-name}/Fonts folder.
  3. In Xcode, select your project and then your target. Navigate to the Build Phases tab and expand the Copy Bundle Resources section.
  4. Click the + button and add all the font files you just copied into the Fonts folder.
  5. Save your changes and rebuild your project.

These steps should ensure that the font files are properly linked to your project and that the icons are displayed correctly.

Keep going

2023

how to sort an array

How to Sort an Array If you have an array and you want to order its elements in a specific way, you need to use a sorting algorithm. There are several sorting algorithms available, but two of the most commonly used are…

javascript2 min read
2023

jquery mobile or desktop

jQuery Mobile or Desktop? As a web developer, I have had some experience with both jQuery Mobile and jQuery Desktop. Both frameworks have their pros and cons, and which one to use really depends on the specific project…

javascript1 min read
2023

node.js folder structure

Node.js Folder Structure If you are new to Node.js, it can be daunting to create a folder structure that will work for your project. The structure you choose will depend on the size and complexity of your project. Here…

javascript1 min read
ESC