React-native-vector-icons: react-native link does not link with 0.59.0 for Android

Created on 14 Mar 2019  路  15Comments  路  Source: oblador/react-native-vector-icons

Environment

Mac OS 10.14
Android
react-native-vector-icons version 6.1.0
React Native 0.59.0

Description

react-native link react-native-vector-icons do not link assets for Android with latest React Native 0.59.0

info iOS module "react-native-vector-icons" is already linked
info Android module "react-native-vector-icons" is already linked
info Linking assets to ios project
info Linking assets to android project
error Something went wrong while linking. Error: ENOENT: no such file or directory, copyfile '/MyProject/node_modules/react-native-vector-icons/Fonts/AntDesign.ttf' -> '/MyProject/android/app/src/main/assets/fonts/AntDesign.ttf'
error ENOENT: no such file or directory, copyfile '/MyProject/node_modules/react-native-vector-icons/Fonts/AntDesign.ttf' -> '/MyProject/android/app/src/main/assets/fonts/AntDesign.ttf'

Most helpful comment

Hi @SupriyaKalghatgi , as I know, we have to create the fonts folder by our self, I mean this one:

/MyProject/android/app/src/main/assets/fonts/

Can you have a try?

All 15 comments

@oblador Can you look into this?

Hi @SupriyaKalghatgi , as I know, we have to create the fonts folder by our self, I mean this one:

/MyProject/android/app/src/main/assets/fonts/

Can you have a try?

@truongluong1314520 I never did that before, running link would be just one single step

@truongluong1314520 I tried that, worked
Though it worked before with older versions of react native vector icons with react native just by react-native link (without creating folders manually)

Hi @SupriyaKalghatgi , yes, the version 0.59 has this issue. When you are able to link the library, there is another issue waiting for you, that is we cannot display the FontAwesome5 in Android device 馃槩

@truongluong1314520 Oh!
Did you raise this issue with React Native?

Hi @SupriyaKalghatgi , actually, I don't know if it is react-native-vector-icons issue or react-native 馃槥

You can follow the issue here FontAwesome5 issue

This seems to be a bug in react-native CLI itself and not with this library. There's a fix merged, try upgrading to 1.4.2 or newer.

Facing the same issue on android with Fontawesome5
React-native: 0.59.1
I have used react-native link.
Icons not showing, but when I change to old FontAwesome then some of the icons appear

ios version: Works good with FontAwesome5
android version: Doesn't:

My solution:
Changed all icons back to old FontAwesome version 4.7

@AfanasievN Not related to #964 ?

Exactly same issue as @AfanasievN, works fine on iOS but not on Android. This lib on is latest version (6.4.2) and RN is on 0.59.3. Edit: after reading through https://github.com/oblador/react-native-vector-icons/issues/964 I tried downgrading to 6.3 which fixed it.

@hampustagerud yes they are related

Also double check if the actual font file isn't just missing, which for some reason it was for me https://github.com/oblador/react-native-vector-icons/blob/master/Fonts/AntDesign.ttf

I am facing the same issue. Is there alternative to use icons in react native ?

Was this page helpful?
0 / 5 - 0 ratings