Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native vector icon not showing

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

like image 294
Siddarth Avatar asked Nov 03 '25 12:11

Siddarth


1 Answers

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/

like image 50
Nensi Kasundra Avatar answered Nov 05 '25 10:11

Nensi Kasundra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!