React Native Environment Info:
System:
OS: Linux 3.10 CentOS Linux 7 (Core)
CPU: x64 Intel(R) Core(TM) i5-7600K CPU @ 3.80GHz
Memory: 903.03 MB / 1.80 GB
Shell: 4.2.46 - /bin/bash
Binaries:
Node: 8.12.0 - /opt/node/bin/node
Yarn: 1.10.1 - /opt/node/bin/yarn
npm: 6.4.1 - /opt/node/bin/npm
SDKs:
Android SDK:
Build Tools: 27.0.3
API Levels: 27
npmPackages:
react: ^16.5.1 => 16.5.1
react-native: 0.57.0-rc.4 => 0.57.0-rc.4
npmGlobalPackages:
react-native-cli: 2.0.1
I get this error when running react-native link native-base. I'm trying this package out for the the first time. native-base is set to "native-base": "^2.8.0".
[vagrant@myapp app]$ react-native link native-base
rnpm-install info Linking assets to ios project
rnpm-install WARN ERRGROUP Group 'Resources' does not exist in your Xcode project. We have created it automatically for you.
rnpm-install ERR! Something went wrong while linking. Error: Cannot read property 'UIAppFonts' of null
Please file an issue here: https://github.com/facebook/react-native/issues
Cannot read property 'UIAppFonts' of null
TypeError: Cannot read property 'UIAppFonts' of null
at Object.linkAssetsIOS [as copyAssets] (/home/vagrant/app/node_modules/react-native/local-cli/link/ios/copyAssets.js:45:31)
at Object.keys.forEach.platform (/home/vagrant/app/node_modules/react-native/local-cli/link/link.js:104:16)
at Array.forEach (<anonymous>)
at linkAssets (/home/vagrant/app/node_modules/react-native/local-cli/link/link.js:94:32)
at tasks.push (/home/vagrant/app/node_modules/react-native/local-cli/link/link.js:171:20)
at <anonymous>
I don't have an easily shared demo, unfortunately.
Hmm, I can't reproduce on a clean project. native-base links properly.
My guess is that my ios files aren't correct somehow. Is there a way I can check or restore them?
Ah, I was able to fix it using the above idea:
yarn upgrade react-native@^0.57.1 # Not sure if necessary; I just did it
react-native upgrade # Regenerates ios files
react-native link native-base # Works now
Please feel free to close.
I had this problem and in my case it was because I had renamed the project but forgotten a few folders.
Most helpful comment
Ah, I was able to fix it using the above idea:
Please feel free to close.