bekanur98
bekanur98

Reputation: 520

React-native-vector-icons show obscure symbols

I've installed react-native-vecotor. And when using them, they showing obscure symbols. How to use this library ? Platform: Android

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

const SearchBar = () => {
    return (
        <View style={styles.background}>
            <Icon name="md-body" color='#000'  size={25} />
        </View>
    );
};
const styles = StyleSheet.create({
    background:{
        backgroundColor:'#F0EEEE',
        marginHorizontal: 15,
        height:45,
        borderRadius:5,
    }
});
export default SearchBar;

Upvotes: 1

Views: 2229

Answers (3)

Kashan Haider
Kashan Haider

Reputation: 1204

If you are using react-native version 0.60++ then it must be the linking problem!

I was facing same after updating react-native, but solved by this, Follow my instructions.

  1. Clean your gradlew (Optional but recommended)
    To clean gradle go to android folder and open cmd & run gradlew clean

  2. Go to android/app/build.gradle add this at the end of file => apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

  3. Now re-compile (react-native run-android) It must be working now!..

Upvotes: 4

bekanur98
bekanur98

Reputation: 520

I just reinstall project application from my device. It's works!

Upvotes: 0

Tuan Luong
Tuan Luong

Reputation: 4162

Ionicons has no element name body. You can check here react-native-vector-icons

<Icon name="ios-body" color='#000'  size={25} />

Upvotes: 1

Related Questions