React-native-vector-icons: icon doesnt show properly

Created on 27 Oct 2019  路  3Comments  路  Source: oblador/react-native-vector-icons

I struggling the install this package, actually i installed and followed the instructions however it didnt show. I did manually linked even and autolinking, but it still doesnt seem.
I am working on Android app on W10.

    "@react-native-community/cli": "^3.0.0-alpha.7",
    "react-native": "0.61.2",
    "react-native-vector-icons": "^6.6.0",

In my template view:
import Icon from 'react-native-vector-icons/Ionicons' <Icon name='ios-person' size={28} color={'rgba(255,255,255,0.7)'} style={styles.inputIcon}></Icon>
Also I added top of android/build.gradle file this line : apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
this seems like :
image

Is there any suggestion about that?

Most helpful comment

I'm having the same issue. It seems to have occurred when I converted my Component to a FunctionComponent.

Still troubleshooting.

All 3 comments

I'm having the same issue. It seems to have occurred when I converted my Component to a FunctionComponent.

Still troubleshooting.

So it wasn't because of a FunctionComponent. I had to run react-native unlink react-native-vector-icons and then followed.

I'm still not sure why it just stopped working.

@tomdaniel0x01 I copied all source files then i re-init new project. After that, pasted all source files (not android and ios folders). So, I add apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" on top of android/app/build.gradle . Finally, run react-native run-android in the CMD on windows. Then it works now, I can see icons.
I think my solution is rebuilding android.

Was this page helpful?
0 / 5 - 0 ratings