简体   繁体   English

安装 react-native-vector 图标后无法构建 React Native 应用程序

[英]React native app won't build after installing react-native-vector icons

I've been trying to add react-native-vector-icons in my project recently using react-native 0.63.4 .我最近一直在尝试使用react-native 0.63.4在我的项目中添加react-native-vector-icons However when I build the project I got this from the terminal when I ran this terminal command npx react-native run-ios and the error/warning are as follows:但是,当我构建项目时,当我运行此终端命令npx react-native run-ios时,我从终端得到了这个,错误/警告如下:

In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/json.h:48:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/dynamic.h:796:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/dynamic-inl.h:22:
/Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/Conv.h:1266:44: warning: possible misuse of comma operator here [-Wcomma]
      [&](Tgt res) { return void(out = res), src; });
                                           ^
/Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/Conv.h:1266:29: note: cast expression to void to silence warning
      [&](Tgt res) { return void(out = res), src; });
                            ^~~~~~~~~~~~~~~
                            static_cast<void>( )
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Flipper/xplat/Flipper/FlipperClient.cpp:8:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Flipper/xplat/Flipper/FlipperClient.h:14:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Flipper/xplat/Flipper/FlipperConnectionImpl.h:12:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Flipper/xplat/Flipper/FlipperConnection.h:10:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/json.h:48:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/dynamic.h:796:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/dynamic-inl.h:23:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/Format.h:30:
/Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/String.h:73:18: warning: '\a' command does not have a valid word argument [-Wdocumentation]
 * \' \" \? \\ \a \b \f \n \r \t \v
               ~~^
/Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/String.h:73:21: warning: '\b' command does not have a valid word argument [-Wdocumentation]
 * \' \" \? \\ \a \b \f \n \r \t \v
                  ~~^
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Flipper/xplat/Flipper/FlipperClient.cpp:8:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Flipper/xplat/Flipper/FlipperClient.h:16:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Flipper/xplat/Flipper/FlipperInitConfig.h:10:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/io/async/EventBase.h:46:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/io/async/AsyncTimeout.h:19:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/io/async/EventBaseBackendBase.h:21:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/io/async/EventUtil.h:21:
In file included from /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/Flipper-Folly/folly/portability/Event.h:24:
/Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Headers/Public/libevent/event.h:44:10: fatal error: 'event2/event-config.h' file not found
#include <event2/event-config.h>
         ^~~~~~~~~~~~~~~~~~~~~~~

warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-Glog' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.4, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-PeerTalk' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'boost-for-react-native' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'GCDWebServer' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target'/Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Flipper-RSocket/rsocket/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '/Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Flipper-RSocket/rsocket/benchmarks/CMakeLists.txt' of type 'text' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '/Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Flipper-RSocket/rsocket/benchmarks/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper' from project 'Pods')

** BUILD FAILED **


The following build commands failed:
    CompileC /Users/newuser/Library/Developer/Xcode/DerivedData/numbers-dwsoqoxfvlhqaegkspswqexutfzn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/newuser/workspace/programming/mobile/numbers/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

I further tried to build with Xcode but I got this from it:我进一步尝试使用 Xcode 构建,但我从中得到了这个:

/Users/newuser/workspace/libevent/event.h:44:10: 'event2/event-config.h' file not found

I've tried pod install & pod update still the app won't build.我已经尝试了pod install & pod update仍然无法构建应用程序。

I found a solution please for this link: Solution我找到了这个链接的解决方案:解决方案

i ran into this, you should troubleshoot your installation common problem is not having fonts in infoplist check your infoplist it needs to have我遇到了这个,你应该解决你的安装常见问题是在 infoplist 中没有 fonts 检查你的 infoplist 它需要有

<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>Fontisto.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>
    <string>icomoon.ttf</string>
</array>

if not run如果不运行

react-native link react-native-vector-icons

another solution is to use legacy build system from另一种解决方案是使用遗留的构建系统

workspace settings -> build system -> legacy build system

another thing is另一件事是

If you are using use_frameworks.如果您使用的是 use_frameworks。 in your Podfile you instead need to dynamically load the icon font by doing Icon.loadFont() when boostrapping your application.在您的 Podfile 中,您需要在增强应用程序时通过执行 Icon.loadFont() 来动态加载图标字体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM