xxxxxxxxxx
add this in '/app/build.gradle'
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
xxxxxxxxxx
react-native link react-native-vector-icons
react-native run-android
xxxxxxxxxx
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"
xxxxxxxxxx
import React from 'react';
import { View, Text } from 'react-native';
import Icon from 'react-native-vector-icons';
const IconDirectory = () => {
// Fetch the icon names available in the library
const iconNames = Icon.getIconNames();
return (
<View>
<Text>Icon Directory:</Text>
{
iconNames.map((iconName, index) => (
<View key={index}>
<Icon name={iconName} size={20} />
<Text>{iconName}</Text>
</View>
))
}
</View>
);
};
export default IconDirectory;
xxxxxxxxxx
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
xxxxxxxxxx
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"