如何使react-native图标在react-native Cli创建的项目中工作?

如何使react-native图标在react-native Cli创建的项目中工作?,react-native,React Native,我正在react native Cli项目中使用react native vector图标。我面临以下问题。 这是我的错误 我使用的是React Native 0.60,因此不需要链接库。我也在我的iOS项目中安装了pod。 我还在iOS项目的info.plist文件中添加了以下内容 <key>UIAppFonts</key> <array> <string>AntDesign.ttf</string> <string>E

我正在react native Cli项目中使用react native vector图标。我面临以下问题。 这是我的错误

我使用的是React Native 0.60,因此不需要链接库。我也在我的iOS项目中安装了pod。 我还在iOS项目的
info.plist
文件中添加了以下内容

<key>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>Octicons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Zocial.ttf</string>
</array>
我仍然面临着同样的问题


如果我对行
进行注释,则我的应用程序运行良好

将其放入
文本中

从'react native vector icons/Ionicons'导入图标;
...
常量搜索栏=()=>{
报税表(
搜索栏);};
我所创造的一切

从“React”导入React;
从“@expo/vector icons”导入{Ionicons};
从“react native”导入{View,Text}
常量搜索栏=()=>{
报税表(
搜索栏);};
导出默认类IConample扩展React.Component{
render(){
返回(
{SearchBar()}
);
}
}

@Nudge我为您做了一个示例,并提供了一个链接来查看它。请检查我的答案。我不想使用Expo。就连我也在世博会上运行过。我用的是react nativecli@Nudge这只是使用Expo图标模块来使用零食。请使用您的React本机图标模块,而不是Expo的图标模块。@轻推并使用图标,而不是羽毛。看看我的答案。
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

import React from "react";
import { View, Text, StyleSheet } from "react-native";
import {Feather} from 'react-native-vector-icons';
const SearchBar = () => {
return ( <View style={styles.background}>
<Feather name="search" />
<Text>Search Bar</Text> </View> ); };