Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29452

Question mark is appeared as icon in react native application

$
0
0

I am trying to use Icon into my react native project so i installed :

1.npm install react-native-vector-icons --save

2.react-native link react-native-vector-icons

After this part all icons added to android/app/sec/main/assets/fonts:

ls -l /media/groot/Project/React\ Native/Practices/RNheader/android/app/src/main/assets/fonts
total 1976
-rwxrwxrwx 1 groot groot  70344 Jan  9 16:45 AntDesign.ttf
-rwxrwxrwx 1 groot groot  65584 Jan  9 16:45 Entypo.ttf
-rwxrwxrwx 1 groot groot  13456 Jan  9 16:45 EvilIcons.ttf
-rwxrwxrwx 1 groot groot  58272 Jan  9 16:45 Feather.ttf
-rwxrwxrwx 1 groot groot 125016 Jan  9 16:45 FontAwesome5_Brands.ttf
-rwxrwxrwx 1 groot groot  34092 Jan  9 16:45 FontAwesome5_Regular.ttf
-rwxrwxrwx 1 groot groot 186228 Jan  9 16:45 FontAwesome5_Solid.ttf
-rwxrwxrwx 1 groot groot 165548 Jan  9 16:45 FontAwesome.ttf
-rwxrwxrwx 1 groot groot 313528 Jan  9 16:45 Fontisto.ttf
-rwxrwxrwx 1 groot groot  56976 Jan  9 16:45 Foundation.ttf
-rwxrwxrwx 1 groot groot 112472 Jan  9 16:45 Ionicons.ttf
-rwxrwxrwx 1 groot groot 546548 Jan  9 16:45 MaterialCommunityIcons.ttf
-rwxrwxrwx 1 groot groot 128180 Jan  9 16:45 MaterialIcons.ttf
-rwxrwxrwx 1 groot groot  28364 Jan  9 16:45 Octicons.ttf
-rwxrwxrwx 1 groot groot  54056 Jan  9 16:45 SimpleLineIcons.ttf
-rwxrwxrwx 1 groot groot  25552 Jan  9 16:45 Zocial.ttf
  1. I added to my js file like this:

    import Icon from "react-native-vector-icons/Ionicons";

This is my file:

import React from 'react';
import { View, Text, Button, StyleSheet } from 'react-native';
import Icon from "react-native-vector-icons/Ionicons";


export default HeaderView = () => {
    return (
        <View style={styles.headerStyle} >
            <View style={styles.columnStyle}>
                <Icon name="arrow-back" size={15}/>

            </View>
            <Text>Test</Text>
        </View>)
}

but when i run project on android emulator the icon appears as ? : enter image description here

And i got this warning:

enter image description here

That is my mistake?

I think i added correct the name of icon: enter image description here


Viewing all articles
Browse latest Browse all 29452

Trending Articles