Icons not displaying properly when installing via nrpm strategy- seeing [X] instead
See original GitHub issueI’m using this library and Android Studio to build a react-native android app. Initially, react-native-vector-icons were displaying properly as a result of the rnpm link
installation strategy. Then I renamed one of the font files (Comic Sans MS), and the icons stopped displaying properly.
I attempted to fix the issue by removing the android/app/src/main/assets/fonts
and android/app/build
directories, uninstalling and re-installing this library and peer dependencies. But the icons are still not displaying properly.
I thought the problem only applied to my project’s directories, so I created an entirely new react-native application from scratch, created a new Android Virtual Device, re-installed this library and peer dependencies, but the icons are still not displaying properly. I’m confused by this result.
Please advise. Thank you for your time.
See also: https://github.com/oblador/react-native-vector-icons/issues/233
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (1 by maintainers)
Reproduction Instructions
Testing React Native boilerplate
Initialize a new react-native application:
Use Android Studio to start a new Android Virtual Device (AVD) according to the following specs:
Run the react-native packager.
The boilerplate application shows up in the AVD as expected.
Testing Native-Base
Shut down the packager and the AVD.
Install native-base.
Edit
index.android
to use native-base components:Start the AVD and then the packager to see if native-base components are working:
The components are showing up as expected.
Testing Icons
Shut down the packager and the AVD.
Edit
index.android.js
, just the button:Start the AVD and then the packager to see if the icon is working. As expected, it is not, because the icon assets have not yet been installed.
Shut down the packager and the AVD.
Asset Installation Strategy A (via rnpm)
Per the native-base instructions related to Android using
rnpm
, installreact-native-vector-icons
:This creates a new directory called
android/app/src/main/assets/fonts
which contains some font files.Start the AVD and then the packager to see if the icon is working. Unfortunately it is not.
Asset Installation Strategy C (manually)
According to the manual instructions:
Edit
android/settings.gradle
:Edit
android/app/build.gradle
:Start the AVD and then the packager.
Success!
react-native link react-native-vector-icons
cd android/ && ./gradlew clean && cd .. && react-native run-android