【发布时间】:2021-12-16 05:55:01
【问题描述】:
过去两天我一直在为这个构建错误而苦苦挣扎,我的项目在 android 上运行良好,但我无法在 IOS 上运行它。 我遵循了 IOS 的 react native 文档并安装了所有要求。 我正在使用 Mac OS Catalina,Xcode 12.4。
这是我的 Podfile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
target 'frontend' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
target 'frontendTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!()
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
这是我收到的错误消息:
** BUILD FAILED **
The following build commands failed:
CpResource /Users/alibarznji/Desktop/Projects/grade_application/frontend/node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf /Users/alibarznji/Library/Developer/Xcode/DerivedData/frontend-dgqzfuyktcahthepzaqwwqkxxvej/Build/Products/Debug-iphonesimulator/frontend.app/FontAwesome5_Brands.ttf
CpResource /Users/alibarznji/Desktop/Projects/grade_application/frontend/node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf /Users/alibarznji/Library/Developer/Xcode/DerivedData/frontend-dgqzfuyktcahthepzaqwwqkxxvej/Build/Products/Debug-iphonesimulator/frontend.app/FontAwesome5_Regular.ttf
CpResource /Users/alibarznji/Desktop/Projects/grade_application/frontend/node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf /Users/alibarznji/Library/Developer/Xcode/DerivedData/frontend-dgqzfuyktcahthepzaqwwqkxxvej/Build/Products/Debug-iphonesimulator/frontend.app/FontAwesome5_Solid.ttf
CpResource /Users/alibarznji/Desktop/Projects/grade_application/frontend/src/assets/fonts/regular.ttf /Users/alibarznji/Library/Developer/Xcode/DerivedData/frontend-dgqzfuyktcahthepzaqwwqkxxvej/Build/Products/Debug-iphonesimulator/frontend.app/regular.ttf
(4 failures)
请注意,我的项目中没有使用 Font-Awesome,最后一行错误指向我的名为“常规”的 assets/fonts 文件夹不存在,我已将文件重命名为 K2D -Regular.ttf 之后我运行了命令“pod install”和“pod repo update”。我究竟做错了什么? 提前感谢您的帮助,谢谢。
【问题讨论】:
标签: ios xcode react-native cocoapods build-error