react-native-vector-icons: [Bug]: iOS not displaying the icons correctly

Which package are you using?

react-native-vector-icons

What platform(s) does this occur on?

iOS

What happened?

Screenshot 2024-12-27 at 2 00 29 PM The simulator on the left is the iOS simulator. The display is basically "?"

I tried react-native-vector-icons@10.2.0 @10.1.0 @10.0.0. All showing the same error.

I’m using react-native@0.76.5.

Relevant log output

There isn't any error report.

Minimal reproducible example

No response

Your computer environment

info Fetching system and libraries information...
System:
  OS: macOS 14.6.1
  CPU: (8) arm64 Apple M1
  Memory: 122.19 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.5
    path: ~/.nvm/versions/node/v18.20.5/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.nvm/versions/node/v18.20.5/bin/yarn
  npm:
    version: 10.8.2
    path: ~/.nvm/versions/node/v18.20.5/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK:
    API Levels:
      - "31"
      - "34"
      - "35"
    Build Tools:
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 34.0.0
      - 35.0.0
      - 36.0.0
    System Images:
      - android-35 | Google APIs ARM 64 v8a
      - android-35 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12700392
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/valancewang/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.5
    wanted: 0.76.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 18

Most upvoted comments

same here

I was facing the same issue, but I followed these steps, and it started working for me:

  1. Navigate to the node_modules folder and open the react-native-vector-icons folder. Copy the Fonts folder from there.
  2. Go to the ios folder and then to the APP_NAME folder. Paste the Fonts folder here.
  3. Drag and drop the Fonts folder into Xcode. Make sure to check the options as shown in the screenshot and verify the folder’s location, as indicated.
  4. Add the fonts into info.plist file as mentioned in documentations.
  5. Clear the build folder.
  6. Delete the app from the simulator.
  7. Run the app again.

Image Image

Apologies the MIGRATION guide was outdated. The fonts do still need to be included in the Info.plist. WSe have a handy script to help with that referenced in https://github.com/oblador/react-native-vector-icons/blob/master/docs/SETUP-REACT-NATIVE.md#ios

@valance Did you rebuild the app after updating Info.plist?

Thank you very much for your reply.

I got this error message. npm error 404 Not Found - GET https://registry.npmjs.org/rnvi-update-plist - Not found npm error 404 'rnvi-update-plist@*' is not in this registry.

Same here, I’m getting this problem with material-design-icons

"@react-native-vector-icons/material-design-icons": "^7.4.47"

Update 1:

  • After some tests, I just put the font name in my Info.plist and works well
	<key>UIAppFonts</key>
	<array>
		<string>FontAwesome.ttf</string>
		<string>FontAwesome5_Brands.ttf</string>
		<string>FontAwesome5_Regular.ttf</string>
		<string>FontAwesome5_Solid.ttf</string>
		<string>MaterialDesignIcons.ttf</string> --> this line
		<string>MaterialIcons.ttf</string>
		<string>SimpleLineIcons.ttf</string>
	</array>

I’m having this same issue with RN version 0.73.11 and RNVI versions

"@react-native-vector-icons/ant-design": "^4.4.2",
"@react-native-vector-icons/common": "^11.0.0",
"@react-native-vector-icons/feather": "^4.29.2",
"@react-native-vector-icons/ionicons": "^7.4.0",
"@react-native-vector-icons/material-design-icons": "^7.4.47"

In the migration guide it says:

“Fonts are now automatically loaded on iOS, so you can remove any fonts you have listed in Info.plist”

That does not seem to work. I was able to make icons visible only after adding the fonts to Info.plist

@valance Do you have @react-native-vector-icons/common installed? If so, then npx rnvi-update-plist package.json ios/AppName/Info.plist shouldn’t return that error

You should see it symlinked in node_modules/.bin

Apologies the MIGRATION guide was outdated. The fonts do still need to be included in the Info.plist. WSe have a handy script to help with that referenced in https://github.com/oblador/react-native-vector-icons/blob/master/docs/SETUP-REACT-NATIVE.md#ios

@valance Did you rebuild the app after updating Info.plist?

Same here, I’m getting this problem with material-design-icons

"@react-native-vector-icons/material-design-icons": "^7.4.47"

Update 1:

  • After some tests, I just put the font name in my Info.plist and works well
	<key>UIAppFonts</key>
	<array>
		<string>FontAwesome.ttf</string>
		<string>FontAwesome5_Brands.ttf</string>
		<string>FontAwesome5_Regular.ttf</string>
		<string>FontAwesome5_Solid.ttf</string>
		<string>MaterialDesignIcons.ttf</string> --> this line
		<string>MaterialIcons.ttf</string>
		<string>SimpleLineIcons.ttf</string>
	</array>

Some for me, but only on a physical deviceIm having this issue only on a physical device strangely, all seems to behave as expected in an emulator.