React Native 0.71.1 version uses react-native-elements to report an error: Unrecognized font family 'Material Icons' solution

Recently, I am using React Native to develop an APP, using the UI of react-native-elements, which uses the icon library, and the iOS side reports an error Unrecognized font family 'Material Icons', and the Android side does not report an error, but the icon is not selected and displayed.

environment:

"react-native": "0.71.1",	
"react-native-vector-icons": "^9.2.0",

 

The solution is as follows:

iOS side

Insert the following code in 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>MaterialIcons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Octicons.ttf</string>
<string>Zocial.ttf</string>
</array>

 

 

Android

Copy the files in the node-models\react-native-vector-icons\Fonts directory to the project andriod\app\src\main\assets\fonts directory. If there is no corresponding folder, create one yourself.

Note: No need to modify any configuration of the build.gradle folder

 

 

References:
1. https://blog.csdn.net/m0_59183852/article/details/128103485

Guess you like

Origin blog.csdn.net/qq_35624642/article/details/128960997