Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native vector icon not working on current version 0.60

React native autolink not working for react native vector icons. I fixed this into android with this https://github.com/oblador/react-native-vector-icons/issues/1035

But on IOS i am still facing issues. Please let me know if anyone solved this...Thanks!

Here is screenshot what issue i am facing.

enter image description here

like image 270
Rahul Mishra Avatar asked Jul 11 '19 08:07

Rahul Mishra


3 Answers

This worked for me on an upgraded project and on a brand new RN 0.60.0

For IOS add this to ios/projectname/Info.plist

<key>UIAppFonts</key>
    <array>
        <string>AntDesign.ttf</string>
        <string>Entypo.ttf</string>
        <string>EvilIcons.ttf</string>
        <string>Feather.ttf</string>
        <string>FontAwesome.ttf</string>
        <string>FontAwesome5_Brands.ttf</string>
        <string>FontAwesome5_Regular.ttf</string>
        <string>FontAwesome5_Solid.ttf</string>
        <string>Foundation.ttf</string>
        <string>Ionicons.ttf</string>
        <string>MaterialCommunityIcons.ttf</string>
        <string>MaterialIcons.ttf</string>
        <string>Octicons.ttf</string>
        <string>SimpleLineIcons.ttf</string>
        <string>Zocial.ttf</string>
    </array>

For Android add this line to android/app/build.gradle

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

That is fixed my issues and react native vector icons working in both the platform.

like image 71
Rahul Mishra Avatar answered Oct 15 '22 09:10

Rahul Mishra


If you did react-native link on iOS do cd ios and then pod install.

Some packages still need to be updated by the maintainers to work with react native.

Aniway, if you dont wanna link go inside your podfile and add:

  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

after that do the same steps i said before

like image 37
Auticcat Avatar answered Oct 15 '22 08:10

Auticcat


Run

npx react-native link

at root folder project to resolve this problem.

Hope it helps.

like image 24
Duyv Avatar answered Oct 15 '22 09:10

Duyv