corymsmith / react-native-icons

Quick and easy icons in React Native
MIT License
1.14k stars 141 forks source link

Not working in Android #145

Closed simonexmachina closed 8 years ago

simonexmachina commented 8 years ago

I've just created a new test project with react-native@0.15.0 and the Icons are not displaying in Android. I've pushed the test project to Github for your reference. Pretty sure I've done everything, but please do let me know if I've stuffed up somehow.

simonexmachina commented 8 years ago

I've also tried 0.14 and got the same result.

peterwilli commented 8 years ago

Yeah for me too

peterwilli commented 8 years ago

@aexmachina I figured it out!

I did the following, create a icon like this

<Icon
  style={styles.icon}
  name='fontawesome|android'
  size={70}
  color='#000'
/>

Declare the style:

var styles = StyleSheet.create({
  icon: {
    backgroundColor: '#3b5998',
    color: '#ffffff',
    width: 70,
    height: 70,
  },
});

Now it is visible on my end!

simonexmachina commented 8 years ago

Nope, that doesn't work for me. I see the background color, but not the icon.

corymsmith commented 8 years ago

@aexmachina I just figured out whats going on, you're missing https://github.com/corymsmith/react-native-icons/blob/master/Example/android/app/src/main/assets/fontawesome.json and https://github.com/corymsmith/react-native-icons/blob/master/Example/android/app/src/main/assets/ion.json from the assets directory, see: https://github.com/corymsmith/react-native-icons/tree/master/Example/android/app/src/main/assets

simonexmachina commented 8 years ago

Right, okay thanks. Yes that's fixed it. You might want to add that to the docs, especially because it's not required for iOS.

simonexmachina commented 8 years ago

Okay, it is there - was that added recently? Sorry if I missed it!