10

When running react-native link it gives this error,

the error

It says,

rnpm-install ERR! It seems something went wrong while linking. Error: Cannot read property 'UIAppFonts' of null

Dinuka Salwathura
  • 924
  • 16
  • 33
  • Did you try to add custom font for your IOS app? – Dinith Minura Jan 23 '17 at 09:06
  • @DinithMinura actually machan I was developing an android app, but error comes in linking ios native components. I solved the error in a random method, may not be the best solution. – Dinuka Salwathura Jan 23 '17 at 12:12
  • 1
    OK @Dinuka rnpm command links modules for both android and ios, If you really focusing only for android app, I thinks its good to go with manually installation for android, anyway for the IOS you have to edit Info.plist and add a property called Fonts provided by application (or UIAppFonts if Xcode won't autocomplete/not using Xcode) and add font file names which you added to Xcode project. – Dinith Minura Jan 24 '17 at 11:53

4 Answers4

3

I had this exact same problem. I had accidentally deleted by Info.plist file in my ios directory. Restoring it, fixed my issue.

Matt
  • 4,029
  • 3
  • 20
  • 37
2

I had same issue not quite long, running react-native links will give you error. If you are using yarn simply run:

  1. yarn remove react-native
  2. yarn add react-native
  3. Then run react-native link

This fixed it for me.

Worthwelle
  • 1,244
  • 1
  • 16
  • 19
Frankrnz
  • 694
  • 6
  • 5
2

I had this problem and in my case it was because I had renamed the project but forgotten to update newname in a few folders and files.

Bikram
  • 323
  • 5
  • 10
1

In case anyone runs across this, this is how I fixed the react-native linking issue w/ UIAppFonts:

# Regenerates ios files
react-native upgrade

# Works now
react-native link

Basically, it's pretty similar to the answer that Matt posts above, except I didn't know how to restore it.

montooner
  • 1,112
  • 4
  • 17
  • 29