4

I am using react native version 0.67.3

I install vector icon and i add andriod/app/build.gradle apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

but icon not showing

Siddarth
  • 49
  • 3
  • 6

2 Answers2

7

Use the latest version

"react-native-vector-icons": "^9.1.0",

You can add latest version of it by below command:

npm install react-native-vector-icons@latest

For Android,

write below line in your android -> app -> build.gradle

project.ext.vectoricons = [
    iconFontNames: [ 'MaterialIcons.ttf', 'FontAwesome.ttf', 'MaterialCommunityIcons.ttf', 'Ionicons.ttf'] // Name of the font files you want to copy
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

For iOS,

cd ios & pod install

Use

import Icon from 'react-native-vector-icons/MaterialCommunityIcons';

Note: Give exact icon name from https://oblador.github.io/react-native-vector-icons/

Nensi Kasundra
  • 1,980
  • 6
  • 21
  • 34
0

I have same problem but when I use

<Text><Ionicons/><Text>

Icons will show in navigation bar.