react-native-vector-icons
npm install --save react-native-vector-icons
Check it out : react-native-vector-icons - npm (npmjs.com)
For React Native > 0.60, when pods are installed/updated auto linking will automatically add all fonts to the Build Phases, Copy Pods Resources. Which will end up in your bundle. To avoid that, create a
react-native.config.jsfile at the root of your react-native project with:
module.exports = {
dependencies: {
'react-native-vector-icons': {
platforms: {
ios: null,
},
},
},
};
Edit android/app/build.gradle ( NOT android/build.gradle ) and add the following:
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
Edit android/settings.gradle to look like this (without the +):
rootProject.name = 'MyApp'
include ':app'
+ include ':react-native-vector-icons'+ project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
Edit android/app/build.gradle (note: app folder) to look like this:
apply plugin: 'com.android.application'
android {
...
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
+ compile project(':react-native-vector-icons')
}
compile -> implementation
Good Job Rebuild Project
Comments
Post a Comment