gpt4 book ai didi

ios - react-native run-ios 不断失败

转载 作者:行者123 更新时间:2023-12-05 06:55:25 25 4
gpt4 key购买 nike

在将 MacOS 更新到 Big Sur 之后,由于 Legacy build 已被弃用react-native run-ios 不再起作用,我已经尝试了很多解决方案但没有任何进展我已经为此苦恼了大约 3 天。

旁注,在 xcode 上构建成功

版本:

native react :0.59.10

代码:12

我正在使用 iPhone 11 模拟器,我还尝试了一个真正的 iPhone 11 设备

npx react-native run-ios 的结果在模拟器上:

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening myapp.xcworkspace

** BUILD FAILED **


The following build commands failed:
Ld /myapp/ios/build/Build/Products/Debug-iphonesimulator/myapp.app/PlugIns/myapp.xctest/myapp normal
(1 failure)

模拟器上的另一个:

info ** BUILD SUCCEEDED **


info Installing DerivedData/Build/Products/Debug-iphonesimulator/myapp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
error Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/myapp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

在设备上:

info ** BUILD SUCCEEDED **

info installing and launching your app on Menna’s iPhone...
info ** INSTALLATION SUCCEEDED **

但是应用程序没有出现在设备上,我不知道这怎么可能?!

任何帮助将不胜感激

最佳答案

已解决

  1. 在 xcode 中,转到“项目设置”>“将构建系统更改为新构建系统”
  2. 单击“高级”,然后选择“自定义(相对于工作空间)”并指定如下位置:产品:构建/构建/产品中间体:build/Build/Intermediates.noindex
  3. 在 vs 代码中,打开 node_modules/@react-native-community/cli/build/commands/runIOS/runIOS.js并更改 DerivedData/Build/Products/${configuration}-${device}/${appName}.appbuild/Build/Products/${configuration}-${device}/${appName}.app;
  4. 删除 ios/build 和 DerivedData 内容
  5. 再次运行 react-native run-ios

关于ios - react-native run-ios 不断失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65362362/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com