React-native-vector-icons: React -native 0.60.5 how to configure react-native-vector-icons

Created on 3 Sep 2019  路  8Comments  路  Source: oblador/react-native-vector-icons

Environment

Description

Describe your issue in detail. Include screenshots if needed.

Demo

You can use https://snack.expo.io/ to create a demo that can help users to better understand your problem.

Most helpful comment

Ok, managed to fix it (Android only right now, still need to test iOS).
Make sure there is no linking anywhere (as supposed to be for react-native 60+)
Then only add apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" to android/app/build.gradle

All 8 comments

I have the same question. After upgrading from react-native 59.9 to 60.5, My icons from font-awesome (the normal one, not font-awesome5) are not found anymore.

My own library which I link through react-native.config.js and add with createIconSet(glyphMap, 'myIcons'); do work, but using import Icon from 'react-native-vector-icons/FontAwesome'; does not.

If I try to add the package to getPackages() in MainApplication.java, react-native complains at runtime that the library is linked twice.

Ok, managed to fix it (Android only right now, still need to test iOS).
Make sure there is no linking anywhere (as supposed to be for react-native 60+)
Then only add apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" to android/app/build.gradle

+1

Follow this link to Fix in the IOS https://medium.com/@vimniky/how-to-use-vector-icons-in-your-react-native-project-8212ac6a8f06

Ok, managed to fix it (Android only right now, still need to test iOS).
Make sure there is no linking anywhere (as supposed to be for react-native 60+)
Then only add apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" to android/app/build.gradle

I spent 4 hours trying to figure our this problem I did tried your solution before but don't know why it was not working But its working now thanks a lot. Cheers

Ok, managed to fix it (Android only right now, still need to test iOS).
Make sure there is no linking anywhere (as supposed to be for react-native 60+)
Then only add apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" to android/app/build.gradle

you save my day, thanks!

Was this page helpful?
0 / 5 - 0 ratings