[英]Cant run app in React native on iOS simulator
我正在 MacBook Air m1 上制作 React 原生 iOS 應用程序。 當我在 vscode 中npx react-native run-ios
npx npx react-native run-ios
,出現了很多錯誤:
當我嘗試從 Xcode(來自“name.xcworkplace”)構建它時,我收到了以下錯誤:
當我從 Xcode(來自“name.xcodeproj”)構建它時,它運行 Metro 服務器,但在 iOS 模擬器上構建失敗。 我收到這些錯誤:
這是我的 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, '12.0'
target 'authier' do
config = use_native_modules!
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
target 'authierTests' 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)
#end
end
我試圖弄明白一個星期,但我幾乎迷失了。 如果您有任何問題,請隨時提問!! 非常感謝您的幫助。
問題出在 Xcode 版本中。 我使用版本 13 測試版。 在我重新安裝 Xcode 並下載穩定的 12.5 版本后,它可以工作了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.