11-npm install --save react-native-vector-icons
22-Edit android/app/build.gradle : (add below code)
3 apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
43-Edit android/settings.gradle : (add below codes)
5 + include ':react-native-vector-icons'
6 + project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
74-Edit android/app/build.gradle : (add below code to dependencies)
8 dependencies {
9 ...
10 compile project(':react-native-vector-icons')
11}
125-import fontawesome to App.js :
13import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
1In 'android/app/build.gradle' (not in android/build.gradle),
2
3apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
4
5Then,
6react-native link react-native-vector-icons
7react-native run-android
8react-native start
1//USING EXPO
2
3//Firtsly, install expo icons and import
4import { MaterialCommunityIcons } from "@expo/vector-icons/"
5//Later in your code, use them like this
6<MaterialCommunityIcons color="white" name="close" size={35} />
7
1rootProject.name = 'MyApp'
2
3include ':app'
4
5+ include ':react-native-vector-icons'
6+ project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
1apply plugin: 'com.android.application'
2
3android {
4 ...
5}
6
7dependencies {
8 compile fileTree(dir: 'libs', include: ['*.jar'])
9 compile "com.android.support:appcompat-v7:23.0.1"
10 compile "com.facebook.react:react-native:+" // From node_modules
11+ compile project(':react-native-vector-icons')
12}