Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react native vector icons won't show in android device

I used react-native-vector-icons in my react native project and start app with npm start.

Icons are displaying normally in iOS, but won't show in android.

Things I tried:

  • three method in the doc of react-native-vector-icons (finally I can see *.tff files in the fonts folder)
  • use react-native run-android to start app. Icon shows normal but what I want is integrating react native with my existing android app, not a totally RN app.
  • use jsbundle file instead of debug server in my app

None of above works

So, should I add something to my existing android app?

I don't know how to solve this problem


[email protected]  [email protected]  [email protected]  node v5.10.1  npm v3.8.3 
like image 389
Theodore Avatar asked Aug 10 '16 16:08

Theodore


People also ask

How do I get react-native vector icons?

Installation of React Native Vector Icons. 1. Open your react native project folder in command prompt and execute the below code: npm install react-native-vector-icons --save.


2 Answers

Open android/app/build.gradle and add the following:

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" 

You can follow the instructions to properly install the module on Android: react-native-vector-icons#install-android

like image 143
Luis Fer Garcia Avatar answered Oct 02 '22 14:10

Luis Fer Garcia


I am having the same issue and I fixed it this by executing:

react-native link react-native run-android 
like image 34
Badis Merabet Avatar answered Oct 02 '22 13:10

Badis Merabet