Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

How to resolve react-native-vector-icons only show partial icons in Android and only show question mark in iOS?

$
0
0

Although I almost never do any modification to react-native-vector-icons, the situation regarding this plugins changes over time.

At first, when I take over this project, all the icons works properly.

At some time, after numerous re-npm-init and branch changing between react native 0.59.x and 0.62.x, the Android version suddenly doesn't show partial of the icons (show yellow box warning about the name icon supplied is not there), but the iOS shows.

I resolve the issue by identifying that all the icons that isn't working is from NBIcons. All the icons from Ionicons are working perfectly. So I change all the icons into using Ionicons only. This also including doing react-native init, and add

project.ext.vectoricons = [    iconFontNames: ["AntDesign.ttf", "Entypo.ttf", "EvilIcons.ttf", "Feather.ttf", "FontAwesome.ttf", "FontAwesome5.ttf", "Foundation.ttf", "Ionicons.ttf", "MaterialCommunityIcons.ttf", "MaterialIcons.ttf", "Octicons.ttf", "SimpleLineIcons.ttf", "Zocial.ttf"] // Add fonts needed]apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

at the end of the build.gradle. Problem solved.

But yesterday, the iOS build now suddenly showing weird icons. Now all icons from Ionicons doesn't work with iOS, as well as all the NBIcons. I have tried to react-native unlink and then react-native link again, as well as copy the fonts to the assets folder, but it doesn't work. I have make sure that all the icons used are in the directory. It either showing weird glyph, or showing question mark. Re-npm-init, Product -> Clean build folder, doesn't help. I also confirm that all the fonts are listed on Copy Bundle Resources on Xcode project. But it doesn't make the app shows any yellow box warning, as if the plugin acknowledge that the icon name exists, but unconsciously fail to load the font and display the icon using it.

Oh, and this Xcode project doesn't have workspace. I understand that many of the solutions usually involves reinstalling pods, but just for this release, I have to work with this workspace-less version of the project, thus implying that this is also pod-less. This actually should be not the problem, because the vector icons works fine before this.

From what I've searching around, the solutions available are mostly for solving the Android side, but rarely on iOS side.

Is there anything else I can do to work around this issue on iOS?


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>