1
votes

In my React Native app I'm getting the error "Unrecognized font family: 'Raleway-Regular'". I followed this tutorial to add my fonts, and in the "Optional step" section where you log all your attached fonts to the console, it includes all of them except Raleway-Regular.

However, the strange thing though is that when the app is sitting there in the emulator with the error screen, if I click any one of the font files in my Fonts folder in my project in Xcode, the error screen in my emulator disappears. Once I load any other screen, the error message reappears, and if I click one of the font files in Xcode, it disappears again. Note that when I click on one of the fonts, it does a hot reload of the screen I'm on in the emulator.

Raleway-Regular.ttf is in the Fonts folder in the root of my project and has the correct target membership, it's in my info.plist, it's in Build Phases -> Copy Bundle Resources.

Does anyone know why this might be happening?

1

1 Answers

0
votes

Please add the parent folder path containing the Raleway-Regular.tff

"rnpm": {
   "assets": [
      "./Fonts/"
   ]
 }

Edit, please use this instead:

pls create this file: react-native.config.js with this content :

module.exports = {
  assets: ['./Fonts/'],
};