過去兩天我一直在為這個構建錯誤而苦苦掙扎,我的專案在 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,并且最后一行錯誤指向我的資產/字體檔案夾,名稱為“regular”,我已將檔案重命名為 K2D-Regular。 ttf 之后我運行了命令“pod install”和“pod repo update”。我究竟做錯了什么?我提前感謝您的幫助,謝謝。
uj5u.com熱心網友回復:
從錯誤來看,我認為您正在使用react-native-vector圖示庫作為圖示,需要添加一些字體而那些字體卻缺失了。根據安裝指南,您必須在info.plist檔案中添加字體規范,如下所示:
資訊.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>
<string>Fontisto.ttf</string>
</array>
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/344245.html
上一篇:Maven沒有運行JUnit測驗
