React-native-vector-icons: Icons not being displayed

Created on 5 May 2017  Â·  17Comments  Â·  Source: oblador/react-native-vector-icons

Hi,

I'm trying to use xotahal/react-native-material-ui module but icons doesn't seem to work. I'm opening the issue here, because I can't make icons appear even when using basic example:

import Icon from 'react-native-vector-icons/FontAwesome';
const myIcon = (<Icon name="rocket" size={30} color="#900" />)

I've checked all steps of installation guide and everything seems to be correct, I've also tried steps from troubleshooting, but still nothing.
It looks like the icon is being rendered because if I add the onPress prop it will be activated properly, but icon is not displayed and I can't see it.

Could you please help me find out what could be causing this problem?

Environment details:

  • Windows 10
  • Android 4.1.2 (testing on real device)
  • React Native 0.43
  • react-native-vector-icons 4.1.0

Most helpful comment

Hi, I spent so many hours and found the answer here

https://github.com/GeekyAnts/NativeBase/issues/138

Run
react-native link
& then
react-native run-android

All 17 comments

After several desperate tries of removing and reinstalling node_modules and running
react-native run-android I can finally see icons. 😄

I've done all this but icons are still not displaying. It's tiring. Someone help.

Hi wyz1,

have you checked all the steps from manual installation guide? Also have you tried running react-native run-android command?

Are you testing on a real device or simulator? Try deleting app from it and reinstall it.

Are you trying to run the basic example from the docs or something different?

@lbrdar thank you for your reply. I have tried running react-native run-android command, but it still doesn't display.
I am running from a simulator.
I've tried both the examples from the doc and different ones.

I have tried all commented and I still have the same problem

fix my problem by changing the folder Fonts by fonts

My issue was I forgot to copy the font file to assets/fonts and the [X] got cached.

I proved it by changing com.oblador.vectoricons.VectorIconsModule and changing cacheFile.exists() to false

Hi, I spent so many hours and found the answer here

https://github.com/GeekyAnts/NativeBase/issues/138

Run
react-native link
& then
react-native run-android

@lbrdar
thank u ♥

Hello,
I tried all the above solutions but it doesn't work for me. I am using react native .64. Can anyone help me out.

@ihirakh you save my day

write this command

react-native link

this command will download fonts of react native vector icons in both of
android and ios then the icons will show

On Sat, Nov 2, 2019 at 11:58 AM faysalJadoon notifications@github.com
wrote:

Hello,
I tried all the above solutions but it doesn't work for me. I am using
react native .64. Can anyone help me out.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/oblador/react-native-vector-icons/issues/463?email_source=notifications&email_token=AH6T4I6LVJASFTJN574Q7XDQRVFM3A5CNFSM4DKJLOUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC4YH4I#issuecomment-549028849,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AH6T4I3LS3LEI3QLIBBR2F3QRVFM3ANCNFSM4DKJLOUA
.

Once after installing the module, link it to the project.

react-native link react-native-vector-icons

yeah, i also faced this issues, then i run gradlew clean in android folder and react-native link and then finally run react-native run-android so my problem is solved and finally icon showing successfully

Hi, I spent so many hours and found the answer here

GeekyAnts/NativeBase#138

Run
react-native link
& then
react-native run-android

God bless u man

@MaxxNine thank you thats work

Was this page helpful?
0 / 5 - 0 ratings