react-native-vector-icons 字体重复导入
今天在一个新项目中第一次运行 npx react-native run-ios
的时候出现这个错误:
Multiple commands produce '/Users/nonlinearthink/Library/Developer/Xcode/DerivedData/GuyunwenchuangReactNative-fgninddwwlekuebqvtncoivevuxu/Build/Products/Debug-iphonesimulator/GuyunwenchuangReactNative.app/Zocial.ttf':
猜测可能是我使用了 npx react-native link
导致的问题,在 react-native-vector-icons
的 issue
中找到了解决办法。
删除 Copy Bundle Resources
里面和 react-native-vector-icons
相关的字体文件。Copy Bundle Resources
和 Copy Pods Resources
中存在相同的字体资源文件,导致了 xcode
重复导入报错了。
react-native 0.63 BUG
CompileC /Users/nonlinearthink/Library/Developer/Xcode/DerivedData/GuyunwenchuangReactNative-fgninddwwlekuebqvtncoivevuxu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper-Folly.build/Objects-normal/x86_64/SSLSessionImpl.o /Users/nonlinearthink/Project/org.guyunwenchuang/GuyunwenchuangReactNative/ios/Pods/Flipper-Folly/folly/ssl/detail/SSLSessionImpl.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
看上去是 Flipper-Folly
这个依赖出问题了,我在 react-native 的 issue 中找到了答案。
修改 Podfile 中的内容,把
use_flipper!
修改成
use_flipper!({ 'Flipper-Folly' => '2.3.0' })
接下来是常规操作:
cd ios
pod install
pod update
参考
‘Multiple commands produce’ error when building with new Xcode build system #20492
Can’t compile initial project for iOS #30922
react-native-app-failing-to-compile-module-not-found