Search code examples
reactjsreact-nativereact-native-vector-icons

"None of these files exist" when try to use vertical icons reac native


I have installed React Native Vector Icons, I have changed the android/app/build.gradle adding apply from: "../../node_modules/react-native-vector-icons/fonts.gradle".

When I try to import icons in the file (for example):

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

const HomeScreen = () => {
    return (
        <View style={styles.page}>
            <Ionicons name="ios-camera-reverse" />
        </View>
    );
};

export default HomeScreen;

then I got an error (screen):

Image

I have installed React Native Vector Icons, I have changed the android/app/build.gradle adding apply from: "../../node_modules/react-native-vector-icons/fonts.gradle".


Solution

  • Try to change Import:

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

    check default import here: https://github.com/oblador/react-native-vector-icons/blob/master/MaterialIcons.js