几天前我买了一台带有 M1 芯片的新 MacBook Air,我只是想设置我的 React Native 和 Xcode 等,运行以编写 iOS 应用程序。
我之前在使用“npx react-native init AwesomeProject”时遇到了一些问题,但希望它已得到解决。 React-Native Error + Bug in Ruby Interpreter: Failed to install CocoaPods dependencies for iOS project, which is required by this template
我认为 init 成功了,因为我得到了以下彩色运行指令:
Run instructions for Android:
• Have an Android emulator running (quickest way to get started), or a device connected.
• cd "/Users/boscotsin/Documents/react/test4" && npx react-native run-android
Run instructions for iOS:
• cd "/Users/boscotsin/Documents/react/test4" && npx react-native run-ios
- or -
• Open test4/ios/test4.xcworkspace in Xcode or run "xed -b ios"
• Hit the Run button
Run instructions for macOS:
• See https://aka.ms/ReactNativeGuideMacOS for the latest up-to-date instructions.
然后我根据 React Native 文档进行第二步,即 cd 到目录中,然后运行“npx react-native start”,但它不起作用。我有两个选择:
To reload the app press "r"
To open developer menu press "d"
无论我选择哪个选项,它都会说没有连接应用程序,我将收到以下任一提示:
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Reloading app...
warn No apps connected. Sending "devMenu" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Opening developer menu...
我也尝试直接运行“npx react-native run-ios”,它也会说构建不成功...
我可以知道这里出了什么问题吗?
或者我应该一劳永逸地重新安装Xcode或其他一些东西???