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
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}
1project.ext.vectoricons = [
2 iconFontNames: [ 'MaterialIcons.ttf', 'EvilIcons.ttf' ] // Name of the font files you want to copy
3]
4
5apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"