无法识别的字体系列Material Icons?

时间:2019-03-14 09:21:23

标签: react-native react-native-elements react-native-vector-icons

我是React-Native的新手,我已经向Xcode和Android studio手动添加了react-native-vector-icons库。如果使用Xcode运行代码,则执行成功,不会出现任何问题。但是,如果我尝试从Terminal(react-native run-ios)运行代码,则在模拟器中显示“无法识别的字体系列Material”。但是如果我运行命令(react-native run-android),同样可以正常工作。

请帮助我。 这是在终端Error Screen shot

中显示的错误
** BUILD FAILED **


The following build commands failed:

    CompileC /Users/user/Documents/Test/JobsNProfiles/ios/build/Build/Intermediates.noindex/RNVectorIcons.build/Debug-iphonesimulator/RNVectorIcons.build/Objects-normal/x86_64/RCTFont+FA5.o /Users/user/Documents/Test/JobsNProfiles/node_modules/react-native-vector-icons/RNVectorIconsManager/RCTFont+FA5.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

3 个答案:

答案 0 :(得分:1)

我不确定您的配置中到底缺少什么,所以我将陈述所有我认为的情况:

  1. 删除ios / build文件夹,然后尝试自动链接:react-native link react-native-vector-icons

  2. 确保已在构建阶段中检查了副本库资源中的字体是否已复制。如果没有,请重新检查手动配置步骤。

  3. 确保终止打包程序,然后重新运行以使更改生效。

答案 1 :(得分:1)

我找到的解决方案是检查字体是否添加到 Info.plist 文件中的UIAppFonts数组中:

 TypeError: chai.request(...).post(...).send(...).then(...).put is not a function

有关更多信息,here

答案 2 :(得分:0)

最简单的

您只需将以下内容添加到您的 Podfile


# Normal
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'


# If you are using monorepo
# pod 'RNVectorIcons', :path => '../../../node_modules/react-native-vector-icons'


然后运行

yarn podinstall