react native vector icons won't show in android device

Theodore picture Theodore · Aug 10, 2016 · Viewed 24.3k times · Source

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

Answer

Luis Fer Garcia picture Luis Fer Garcia · Aug 10, 2016

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