react-native-vector-icons: Icons fail to show on Release Build!

Environment

  • iOS (Release build)
  • react native 0.63.1
  • react native vector icons: latest

Description

In debug/development everything works fine. Icons show as usual. But once I build the app for release/production, the Icons don’t show up. Not even question-mark boxes.

image

(Bottom bar should be Icons)

I have auto-linked the library, but specified only “MaterialCommunityIcons” in my Info.plist, because that’s the only set I use. Do I still have to leave all of them in there?

~Also, I have called Icon.loadFont() at the entry point. (top of App.tsx)~ <-- Not required, as I’m not using use_frameworks! in my Podfile.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 3
  • Comments: 23 (9 by maintainers)

Most upvoted comments

@r0stig do you still have to do those steps in >0.60 with autolinking?

I’m using 0.63.2 and I had to add that line in build.gradle after updating to 7.0.0 for all icons to work.

I have the same issue with react-native 0.69.9. Is there any updates?

just add apply from: “…/…/node_modules/react-native-vector-icons/fonts.gradle” in the bottom off android/app/build.gradle ( NOT android/build.gradle ) then sync again the project and icon will show correctly

Just to make sure, you have followed the installation instructions? The important one including the line in build.gradle for Android and running pod update for iOS (instructions here https://github.com/oblador/react-native-vector-icons).

I had the same problem with icons only loaded lazy were showing, but once I included the above line in build.gradle all icons were showing.

@oblador I don’t think it is related to #1212, as the icon in the purple button isn’t visible either, and that should be white.

Also, I’ve reset the simulator but that didn’t change anything. Also happens on physical device.

Also, I noticed that some icons actually do render, mainly those that are rendered lazily. The Icons at the bottom (tab navigator bottom bar) are rendered almost instantly on app launch, which apparently fails most of the time. Icons I have inside another screen which will only be rendered once I navigate to it (in my case the “add” screen when I press the big purple button), which apparently works. I’ve got a camera and photo gallery Icon in there and they showed up.

Do you maybe have some native logic that gets initialized lazily?